0

I have created a small webpage, where I would like to animate content using jQuery during navigation. It's working perfectly in Internet Explorer. If I use Firefox it's not working properly.

My code is as follows

$("#maincontent").animate({"top":"450px"},800, function(){
 $("#maincontent").html($("#"+Lidentity).html())
 .animate({"top":"-10px"},600)
 .animate({"top":"10px"},100)
 .animate({"top":"-5px"},100)
 .animate({"top":"5px"},100)
 .animate({"top":"0px"},100);
});

I have set the #maincontent element position as absolute.

Peter Mortensen
31.3k22 gold badges110 silver badges134 bronze badges
asked Jul 2, 2009 at 6:32
1
  • what actually happens in firefox? nothing? Do you have Firebug installed in Firefox? It will help you track down the error. Commented Jul 2, 2009 at 7:07

1 Answer 1

2

If you're trying to make it look like it bounces with your animation, you're much better off using the easings from jQuery UI.

Example (based off your code):

$("#maincontent").animate({"top":"450px"},800, function(){
 $("#maincontent").html($("#"+Lidentity).html())
 .animate({"top":"0px"},800,"easeOutBounce");
});

Obviously for this to work you also need to add a reference to jQuery.UI (either the full bundle or at least effects.core.js & effects.bounce.js)

answered Jul 2, 2009 at 6:36
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.