Mike
Mike

Reputation: 49

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?

Upvotes: 1

Views: 217

Answers (2)

jantimon
jantimon

Reputation: 38140

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>

Upvotes: 1

mkoryak
mkoryak

Reputation: 57938

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

 $(animateIt);

Upvotes: 0

Related Questions