GithubHelp home page GithubHelp logo

Comments (7)

rufncrus avatar rufncrus commented on August 11, 2024

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.

noptoboggan avatar noptoboggan commented on August 11, 2024

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.

noptoboggan avatar noptoboggan commented on August 11, 2024

In addition to my previous comment, this pending pull request has updated the code to work with window.

https://github.com/mirikle/jquery.smoothwheel/blob/0b7dd07751387c5d4aaec9259b117a2e5e226abf/src/jquery.smoothwheel.js

Making the cross browser page scrolling solution.

$(window).smoothWheel();

from jquery.smoothwheel.

kunal-creative avatar kunal-creative commented on August 11, 2024

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.

noptoboggan avatar noptoboggan commented on August 11, 2024

@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.

noptoboggan avatar noptoboggan commented on August 11, 2024

@kunal-creative Also, there was a typo in my comment about the pull request, should have been:

$(window).smoothWheel();

My apologies.

from jquery.smoothwheel.

kunal-creative avatar kunal-creative commented on August 11, 2024

@R-eenignE Thank you. It works for me.

from jquery.smoothwheel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.