0

I am trying to fade in whatever shows up in (div id="content").

I have this to load JQuery to the page:

<script type="text/javascript"
    src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script type="text/javascript" src="rocoffee.js"></script>

And here is what is in rocoffee.js

$(function(){
$('#content').fadeIn('slow');
});

I have yet to see this event take place when I load my page.

Note: I do have a jquery.js file to use, but I tried to use the above based on answers I've read. Same outcome regardless.

3 Answers3

4

You need to hide it first!

http://jsfiddle.net/wVTab/

$(function(){
    $('#content').hide();        
    $('#content').fadeIn('slow');
});
Timm
  • 12,553
  • 4
  • 31
  • 43
  • Wow, that was obvious. I thought I had taken care of that in my css, I guess not. Thanks –  Oct 13 '12 at 15:06
2

As no HTML code is availabe, i would assume that the div is initially visible, and therefore suggest that fadeIn does not make much sense.

Try setting the div hidden.

Rudolf Mühlbauer
  • 2,511
  • 16
  • 18
1

Try using:

$(document).ready(function(){
    $('#content').fadeIn('slow');
});

instead

Arthur
  • 1,433
  • 1
  • 18
  • 35