views:

21

answers:

2

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?

A: 

why are you running this script before the document is ready? have you tried replacing animateIt(); with

 $(animateIt);
mkoryak
+1  A: 

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>
Ghommey