April 8, 201313 yr Yes... I am still at this.in fact I made a restart because I was most likely too busy fixing problems, rather then building the final result.I made a completely new setup which has only 1 scrolling div. And quite frankly, I am still terrible with jquery.I editted the jquery which I used for easing the scrolling on the first go. live: www.thijsch.nl/4peoplefiddle: http://jsfiddle.net/Tieskevo/TX8ey/I tried to change the animate from html, body to the new element that has to move, namely the div #scrolling.But apparently that would be too easy. Which is great, because it means I get to spend 2 hours of researching different options,not that it really got me any further.. $(document).ready(function() { $("nav a , #logo a").bind("click",function(event){ event.preventDefault(); var target = $(this).attr("href"); $("html, body").stop().animate({ scrollLeft: $(target).offset().left, scrollTop: $(target).offset().top }, 2500); }); }); $(document).ready(function() { $("nav a , #logo a").bind("click",function(event){ event.preventDefault(); var target = $(this).attr("href"); $("#scrolling").stop().animate({ scrollLeft: $(target).offset().left, scrollTop: $(target).offset().top }, 2500); }); }); Edited April 8, 201313 yr by Tieskevo
April 9, 201313 yr try now jsfiddle net / ebqzB / 1 / $(function() { $('nav a').bind('click.smoothscroll',function (x) { x.preventDefault(); var scroll = this.hash; $scroll = $(scroll); $('#content').stop().animate({ 'scrollLeft': $scroll.offset().left }, 500, 'swing', function () { window.location.hash = scroll; }); }); }); no need for jquery.smooth-scroll.js Edited April 9, 201313 yr by Guest
April 19, 201313 yr Author I'm reopening this, because I noticed it has a fatal flaw: it only scrolls correctly from the home "page". id you go from any other page to anything but the home page, it gives varying results. it doesn't move at all then jumps to the right anchor. it moves back to the homepage first then jumps to the anchor. I have no idea how to solve it. I've been stuck at this for waaaay too long. Edited April 19, 201313 yr by Tieskevo
April 24, 201313 yr Take a walk, get some fresh air, clear your head. When you come back you will discover that you forgot to link to jquery on your sub pages or somthing obvious like that.
April 25, 201313 yr Author solved it with: http://flesler.blogspot.nl/2007/10/jquerylocalscroll-10.html
Create an account or sign in to comment