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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -