GithubHelp home page GithubHelp logo

jnicol / trackpad-scroll-emulator Goto Github PK

View Code? Open in Web Editor NEW
217.0 217.0 44.0 110 KB

A jQuery plugin that emulates OSX trackpad-style scrollbars in any browser or platform.

License: MIT License

JavaScript 81.36% CSS 18.64%

trackpad-scroll-emulator's People

Contributors

davidyorr avatar jnicol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trackpad-scroll-emulator's Issues

scrollbar not support scrollbar inside scrollbar

I create a textarea with scroll bar inside a dynamic div with scrollbar.

the inner textarea is not changing the scrollbar. I also found how to fix it:

LINE 36: var $contentEl = $el.find('.tse-content:first');
LINE 61: $scrollbarEl = $el.find('.tse-scrollbar:first');
LINE 62: $dragHandleEl = $el.find('.drag-handle:first');
LINE 67: $scrollContentEl = $el.find('.tse-scroll-content:first');

Native mobile scrolling

Great little script; works a treat!

Just wondering if there's a way to override the script to allow native touch scroll on iOS devices etc?

fire fox not returning $el.width() correctly

sometimes with firefox : if .tse-content has a lot of nested elements and *{box-sizing: border-box;} jQuery will not return return the width correctly and ends up showing 10px of the hidden moz scrollbar.

work around in function resizeScrollContent()
change
$scrollContentEl.width($el.width() + scrollbarWidth());
to
$scrollContentEl.width(parseInt($el.css('width'))+scrollbarWidth());

Scroll bar does not show

Sometimes you may have hidden elements nested inside visible elements or dynamically loaded elements with hidden elements. Ocassionally it causes the browser to return a zero height of the .tse-content div.

work around / fix : .tse-content { overflow:hidden; } to force the browser to resize the tse-content div to its containing elements and return the $(".tse-content").height() correctly.

scrollbar on nested elements within a scrollbar element doesn't scroll

If I combine the fullpage scrolling with scrollable boxes, the drag-handle is sticky on top of the boxes.
Only the fullpage container is correctly scrolling on mouseinteraction.
The boxcontent ist scrolling on mouseinteraction but the drag-handle remains on top of the box container.

There are maybe referencing issues on the eventtracking and drag-handle moving.

any way to nest this?

For instance, an outer container uses vertical scrollbar, and an inner container uses horizontal scrolling. Doesn't seem to be possible. Perhaps clarify this in the readme statement regarding using both?

Nasty fix for Firefox OS X not working

The new version of firefox for mac osx supports the os scroll bar, so this workaround c2be16e does not work any more.

I am trying to fix this, but if someone already has a fix, please share.

scrollLeft override?

Is it possible the plugin overrides the scrollLeft javascript function?

I have this code to make the page scroll horizontally (with mousewheel plugin):

$('html, body, *').mousewheel(function(e, delta) {
    this.scrollLeft -= (delta * 60);
    e.preventDefault();
});

(this doesn't work in Firefox for some reason...)

But it doesn't work anymore one I implemented the scroll-emulator plugin.

Add a maintainer?

Would you like help maintaining this library? I'm using this library in an Ember.js addon and I want to make sure it doesn't go unmaintained as antiscroll did.

Let me know

How can I manage scrollTop?

Thank you for this plugin.
I'm using TrackpadScrollEmulator Version: 1.0 in backbone app.
I want to manage scrollTop when user navigate to previous page.
But I couldn't find how to.
Any tips?

Horizontal scroll issue

Tried to invoke the horizontal scroll emulator on a click of button for the demo2 as-is in index.html like:

$('.add-boxes').on('click', function(e){
e.preventDefault();
$('.demo2 .tse-content .boxes').append('

11
');
$('.demo2').TrackpadScrollEmulator('recalculate');
});

The scrollbar size is not recalculated and the boxes wrap down is there anything vital missing .

Example mistake

$('wrapper').TrackpadScrollEmulator();

Should be

$('.wrapper').TrackpadScrollEmulator();

:)

Does not account for margins.

If there are margins in the tse-content element, then the scrollbar will disappear past the border of the div when you scroll to the bottom.

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.