jnicol / trackpad-scroll-emulator Goto Github PK
View Code? Open in Web Editor NEWA jQuery plugin that emulates OSX trackpad-style scrollbars in any browser or platform.
License: MIT License
A jQuery plugin that emulates OSX trackpad-style scrollbars in any browser or platform.
License: MIT License
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');
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?
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());
When I save html content with scrollbars in it and then replace it then methods doesn't work , however jquery.contents() keeps objects the same. So what's wrong ?
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.
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.
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?
Can this be used on the body?
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.
Your plugin is great ! The demo should be visible easily on github pages !
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.
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
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?
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('
The scrollbar size is not recalculated and the boxes wrap down is there anything vital missing .
How do we retrieve the top position while scrolling?
Thanks!
$('wrapper').TrackpadScrollEmulator();
Should be
$('.wrapper').TrackpadScrollEmulator();
:)
Would be great.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.