问题
I'm using this jQuery plugin to get a one-page scroll effect.
However, as you can see on this page, it doesn't work and instead just locks the scroll.
jQuery is working fine - I can run an alert for example. Might the CSS file that comes with the plugin be conflicting with my existing one?
Thanks in advance for your help!
回答1:
please try to call these two files from your server
https://raw.github.com/peachananr/onepage-scroll/master/jquery.onepage-scroll.min.js
https://raw.github.com/peachananr/onepage-scroll/master/jquery.onepage-scroll.js
It is to prevent XSS (cross-site scripting) attacks Check more details about it
回答2:
If you want more compatibility with old browsers such as IE8, 9, Opera 12... and some more functionalities, here's another great plugin for it, is called fullPage.js:
- Demo
- Page
Some features it adds to the one you are using:
- Use it over IE 8 and old browsers with no CSS 3 support.
- Compatibility with touch devices
- Plenty of more options and functions
- Scroll bar for a better UX experience
- Use of anchors in the URL
- Add a live menu.
- Slide throw the page using the keyboard shorcuts (arrows, spacebar, pageUp/pageDown, home, end...)
- Add horizontal sliders.
来源:https://stackoverflow.com/questions/19057204/jquery-one-page-scroll-not-working