Is it possible to keep a simple function like this here:
$.fx.speeds.xslow = 1500;
function goToByScroll(id){
$('html,body').animate({
scrollTop: $("#"+id).offset().top
},'slow');
}
and make it for horizontal scrolling?
I want to keep things simple like this without using a big horizontal plugin. I was thinking scrollLeft, but could not get this to work with the offset… Any ideas would be great! Thanks in advance
Like you said, you can do this using scrollLeft:
See this fiddle for a working example (make sure Div #3 isn’t visible on the page when you run it).