jQuery one-page scroll not working

大兔子大兔子 提交于 2020-01-14 05:24:28

问题


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

  1. https://raw.github.com/peachananr/onepage-scroll/master/jquery.onepage-scroll.min.js
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!