jakiestfu / Snap.js

A Library for creating beautiful mobile shelfs in Javascript (Facebook and Path style side menus)
http://jakiestfu.github.io/Snap.js/
5.99k stars 663 forks source link

When toggle button is tapped in the header to open the sidebar the content page jumps to top. #175

Closed nodkrot closed 10 years ago

nodkrot commented 10 years ago

The plugin is great!

However, when i implemented fixed header and press toggle button in the header to open the sidebar the content page jumps to top. Any way to prevent that?

jakiestfu commented 10 years ago

Sure. If you're using a link that has an href attribute set to "#", it will cause this jump. Simply call e.preventDefault() on your click event. Snap.js v2.0 will add support for easier ways to toggle things.