Snap.js
Snap.js copied to clipboard
Snap.js and scrollit (or anchor smooth scrolling)
Great job for this plugin! But I can not seem to scroll the page with anchors. this does not work either with the plugin scrollit I do not understand ... Here is my code: $ (function () { $ ("a [href * = '#']"). click (function () { $ ('# content'). animate ({ scrollTop: $ ($ attr (this, 'href').) offset () top.. }, 1000); return false; }); });
I have put # content instead of body, html but nothing works Thank you in advance!
Could you set up a testcase using http://jsfiddle.net or similar?
check => david.gaspardmacelin.com/portfolio thanks !
Reduced test case required
All bug reports and problem issues require a reduced test case. See http://css-tricks.com/reduced-test-cases/ on why they "are the absolute, ... number one way to troubleshoot bugs."
- A reduced test case is an isolated example that demonstrates the bug or issue.
- It contains the bare minimum HTML, CSS, and JavaScript required to demonstrate the bug. No extra functionality or styling.
- A link to your site is not a reduced test case.
Hi, I am having the same issue. After lot of debugging, i found that the position:absolute for the following css style is causing default scrollTop to fail.
snap-drawer, [snap:drawer], [snap-drawer], [data-snap-drawer], [x-snap-drawer], .snap-drawer, .x-snap-drawer, .snap-drawer{ position: absolute; }
If we comment out this part, scrollTop works perfectly.