Search code examples
javascriptjquerycssfade

Jquery div fadeIn on load not working


I just have a Div ".text" that i want to fade in on a subdomain page… I googled on stackoverflow and came up with this:

<script type='text/javascript'>
$(function(){  // $(document).ready shorthand
$('.text').hide().fadeIn('400');

});
</script>

The CSS is just font styling… I even tried it before with a display:none; and without the .hide() but somehow it does not work… I load this jQuery:

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>

Do I need another one? Or do I need to name the subdomain in the script? I wanted to put the script in my index.php file… I just can not explain it to myself…


Solution

  • Load the script file next to including the Jquery plugin.

    Since there is no fault in your code.

    This may be the problem.