html - jQuery fadeIn Doesn't seem to run? -


very simple jquery project practice. have set button ( #btn ) , wanted see if possible fade in div when click button. set fiddle, wrong code itself?

link jsfiddle.

--code--

-jquery-

> jquery(function() {  >           $('#btn').click(function(){ >               $('#text2').fadein(1000); >               });      }) 

--html--

<div id="btn">      <button>click me!</button>   </div>  <div id="text">  <h1> hello </h1>  </div>  <div id="text2">  <h2 style> hi there! <h2>  </div> 

fadein() works display:none; css property, not opacity. use .css('opacity', '1') or animate that...

jsfiddle


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -