Comments (7)
Hi DonDi1989!
I just tested demo (http://fatlinesofcode.github.io/jquery.smoothwheel/demo/smoothwheel.html) in most recent version of IE, Firefox and it worked for me. What versions specifically is it not working in?
from jquery.smoothwheel.
If the desire is to smooth scroll the entire document, IE and Firefox overflow in to html
, while WebKit overflows in to body
.
Calling smoothWheel
on both does not seem like a good idea, attaching scroll listeners to both and wasting execution time.
Best to detect where the overflow is and call smoothWheel
there, instead of checking the user agent for WebKit.
$(document.documentElement.scrollHeight > document.documentElement.clientHeight ? 'html' : 'body').smoothWheel();
A couple things to keep in mind. This is intended for full page smooth scrolling, and can be affected by styles on the html
and body
tags.
Below is the same functionality in a more readable format.
var overflowInHtml = document.documentElement.scrollHeight > document.documentElement.clientHeight;
var scrollingTag = overflowInHtml ? 'html' : 'body';
$(scrollingTag).smoothWheel();
from jquery.smoothwheel.
In addition to my previous comment, this pending pull request has updated the code to work with window
.
Making the cross browser page scrolling solution.
$(window).smoothWheel();
from jquery.smoothwheel.
Hello
I am not sure which part i am missing. I used the latest js from
https://github.com/mirikle/jquery.smoothwheel/blob/0b7dd07751387c5d4aaec9259b117a2e5e226abf/src/jquery.smoothwheel.js
Now in html i use
1: var overflowInHtml = document.documentElement.scrollHeight > document.documentElement.clientHeight;
var scrollingTag = overflowInHtml ? 'html' : 'body';
$(scrollingTag).smoothWheel();
It works in firefox,IE not in chrome
2: $(window).smoothScroll();
Not working in any browser.
Please help. Thanks
from jquery.smoothwheel.
@kunal-creative The link you provided was a pull request intending to add support for window scrolling. Have you tried with the latest version of the main fork here? Check if the following works in the user agents you're concerned with using the main fork.
$('html, body').smoothWheel();
If it does, that would indicate the conditional setting overflowInHtml
may not be returning the desired value on your site for the user agents where it did not work before. Without seeing the site, its markup structure and CSS it is difficult to assist beyond this.
from jquery.smoothwheel.
@kunal-creative Also, there was a typo in my comment about the pull request, should have been:
$(window).smoothWheel();
My apologies.
from jquery.smoothwheel.
@R-eenignE Thank you. It works for me.
from jquery.smoothwheel.
Related Issues (20)
- html, body { height :100% } HOT 2
- Position scroll issue with drag and roll
- Page scrolling becomes extremely slow in mobile devices
- Scroll bottom limit higher than body height HOT 2
- custom scrollbar HOT 1
- Not Scrolling in firefox v37 HOT 3
- Not Scorlling HOT 2
- The plugin works fine!
- Conflict with anchor menu and css animations HOT 1
- Trackpad Issues HOT 2
- bower
- Div Height Dependance
- ajax append
- Scrolling for multiple div
- How to make it work on main scroll ? HOT 1
- <! DOCTYPE html> not work
- Conflict with anchor scroll that uses jquery. HOT 2
- Using a class instead of ID?
- Issue with fixed background image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.smoothwheel.