Jquery problem slidedown
Hallo i have this script:
<script type="text/javascript">
function animateIt() {
$(".logo img").slideUp("slow")
}
animateIt();
</script>
When i use slideup. The image going away to the top. But i 开发者_开发百科wil use the slidedown. But when i change slide up to slideDown("slow"). My .logo img is not working? What do i wrong?
You have to wait for the dom to be ready:
<script type="text/javascript">
function animateIt() {
$(".logo img").slideUp("slow")
}
//wait for the onload event:
$(animateIt);
</script>
why are you running this script before the document is ready? have you tried replacing animateIt(); with
$(animateIt);
精彩评论