-1

Can someone please correct my code here. It works well in most browsers but I get an error in ie7. I'm sure it's a syntax thing:

 <script type="text/javascript">
$(document).ready(function() {
$(".testimonail-label").addClass("-webkit-animation");
$(".banner h2").addClass("-webkit-animation");
$(".banner .test-name").addClass("-webkit-animation");    
};

4
  • im not sure what you are trying to do, what are you trying to do? Commented May 4, 2011 at 18:24
  • 2
    And what error do you get? "an error" isn't very illuminating. Commented May 4, 2011 at 18:25
  • why are you adding a class on document.ready? just add those classes in the html markup at design time. If you need to change those classes at runtime, on the client, in response to client-side events, then you use JQuery or JavaScript. Commented May 4, 2011 at 18:28
  • As you have a syntax error, I'm pretty sure id does not work in most browsers. Commented May 4, 2011 at 18:37

2 Answers 2

2

You forgot a ')'

 <script type="text/javascript">
$(document).ready(function() {
$(".testimonail-label").addClass("-webkit-animation");
$(".banner h2").addClass("-webkit-animation");
$(".banner .test-name").addClass("-webkit-animation");    
});
Sign up to request clarification or add additional context in comments.

Comments

1

On the last line you forgot to close out the call to ready:

};

should be

});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.