I am trying to implement a one page slider to a homepage and I have it working in FF and IE but not in safari or Chrome..
This is the code I am using for the slider..
//sliding content
$("#main-nav a").click(function(){
var target = $(this).attr("href");
$("html, body").stop().animate({
scrollLeft: $(target).offset().left,
}, 1200);
});
The url of the site in question is http://stable.dev.lemon-fresh.co.uk
Got it!
use
positioninstead ofoffset:scrollLeft: $(target).position().leftAnd remove the comma ‘
,‘ as you are not listing any other properties.And another suggestion:
As I have seen, on fast-clicking on your links – all the animations gets cached resulting in an annoying waiting to get to the right place. A nice trick to remove (clear) that animation queue is to use
.stop(1)try it out!