Morsusy2k Posted January 16, 2013 Share Posted January 16, 2013 Okay so i have some trouble with delaying,take a look at my code: $(document).ready(function(){var container = $('div.slider').css('overflow', 'hidden').children('ul'), slider = new Slider( container, $('#slider-nav') );$(".button1").click(function(){container.animate({ 'margin-left': -1800});});}); And this works fine.But what i want it to do is something like this: $(".button1").click(function(){container.animate({ 'margin-left': -1800 .delay(600); 'margin-left': -1200 .delay(600); 'margin-left': -600}); But i cant manage to make it right..can anyone help?Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted January 16, 2013 Share Posted January 16, 2013 If animate and delay return the element, then you can chain them like this: container.animate({'margin-left': -1800}).delay(600).animate({'margin-left': -1200}).delay(600).animate({'margin-left': -600}); Link to comment Share on other sites More sharing options...
Morsusy2k Posted January 17, 2013 Author Share Posted January 17, 2013 Just what i needed,thank you very much Link to comment Share on other sites More sharing options...
xhtmlchamps1 Posted January 24, 2013 Share Posted January 24, 2013 Hello friend, animate({margin-left: -1800} ,{duration:500});use this code instead of using delay function. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now