Git Product home page Git Product logo

Comments (7)

zozolapino avatar zozolapino commented on August 23, 2024

I forget to say I changed hideNativeScrollbars: function this way:

...
    var size = G.nativeScrollbarSize,
        scrollElStyle = scrollEl.style;
    if(size === 0) {
      // hide Webkit/touch scrollbars
      var time = Date.now();
      scrollEl.setAttribute('data-scroll', time);
      return Utils.addCssRule('[data-scroll="' + time + '"]::-webkit-scrollbar', 'display:none;width:0;height:0;');
    } else {
if( GS.rtl == true ) {
	scrollElStyle.left = -size + 'px';
...

from optiscroll.

albertogasparin avatar albertogasparin commented on August 23, 2024

Rtl support is actually a good idea.
Do you think is it better as an option (like you did) or by checking the directionality of the element (with getComputedStyle(el).direction === 'rtl')?

Anyway, I've tried to set html[dir="rtl"] to Optiscroll website and as you wrote, I had to change the js a bit and the style to be:

.optiscroll-v { left:0; }
.optiscroll-vtrack { left: 4px; } 
.optiscroll.has-vtrack.has-htrack > .optiscroll-h { left: 8px; right: 4px; }

However, what do you mean by "the drag zone is still under the original scrollbar"? Are you referring to the horizontal scrollbar?

from optiscroll.

zozolapino avatar zozolapino commented on August 23, 2024

Checked again but still the same problem with windows 10/chrome: the (trackbar) drag and drop zone is still where the old scrollbar was and the vertical grayed trackbar is displayed 6/10 pixels at right of this drag zone. Like a ghost effect. Strangely there is no problem for the div I use as the main wrapper (width/height:100%). No problem too with firefox/edge/ie11. However with these browsers the text is hilighted when I move the trackbar. I don't use horizontal scrollbars.

getComputedStyle(el).direction === 'rtl' in your code would be nice!

from optiscroll.

albertogasparin avatar albertogasparin commented on August 23, 2024

Please have a look at v3 branch. Run grunt build and open the index.html file. The scrollable box on the right is rtl and it should work ok.

from optiscroll.

zozolapino avatar zozolapino commented on August 23, 2024

Thank-you Alberto!

It works fine on chrome but still buggy on FF/Edge (divs text highlighted when moving the trackbars). I migrated to NiceScroll which works fine at the price of 60KB minified + JQuery... :/

from optiscroll.

albertogasparin avatar albertogasparin commented on August 23, 2024

Well, I've re-checked the code and tested it on FF/Edge: when dragging the scrollbars the selection is prevented.
However the default style of the scrollbars make dragging them quite tricky, so I've noticed that if you miss the target then you are going to trigger the selection. But that is an UX issue.
Anyway, FYI v3 will be ready soon.

from optiscroll.

albertogasparin avatar albertogasparin commented on August 23, 2024

Merged #26

from optiscroll.

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.