Coder Social home page Coder Social logo

Comments (6)

jamesflorentino avatar jamesflorentino commented on July 21, 2024

I tried doing the outerHeight(true) method. It did fix the scenario where the scroller is not needed. But now it bleeds the outer edge when it is. :-(

i've setup a html/css solution for this. http://bl.ocks.org/2007032

You should put the .nano container inside a layer with a padding value. Or add a margin rule to the .nano div content. This way, it allows the content layout to have a breathing space. (which I assume you were aiming for).

from nanoscrollerjs.

jodal avatar jodal commented on July 21, 2024

I forgot to say: my .pane is transparent, so it doesn't matter for me if I add margin to .pane, padding to .pane, or margin to .slider.

Your solution with putting padding on the element containing .nano, or margin on .nano, works for one of my use cases. Though, another of my use cases is using the scroller on a table of data. The table should have no margin at all, and be directly connected to the elements around it. The scroller should be positioned inside the table's border. For this case, adding padding on the element around .nano or margin on .nano doesn't help.

I've created to examples with a scroller inside a table:

  • You can see the broken hiding of the scroller when not needed in the following example, which use margin on the .pane: http://bl.ocks.org/2020855
  • In the other example, http://bl.ocks.org/2020898, I've used margin on .slider. Doing it this way, the hiding of the unneeded scroller works, but the slider length does not care about the slider's margin, so it is a bit too long, and bleeds into the space between the scroller and .content's bottom.

from nanoscrollerjs.

michael-lefebvre avatar michael-lefebvre commented on July 21, 2024

Hi,

the easiest way is to change top and bottom properties of .pane, but you need to change a small portion of code to allow this:

michael-lefebvre@7079d46

from nanoscrollerjs.

mrw4n avatar mrw4n commented on July 21, 2024

What about creating a ratio between the pane height and the content height, and make ur calculations based on this?

use example is if i want to make a fixed height scrollbar, and the content area have different heights, something like the example on the right of this page:

http://manos.malihu.gr/tuts/jquery_custom_scrollbar.html

from nanoscrollerjs.

jodal avatar jodal commented on July 21, 2024

With the release of 0.5.7, this issue is resolved for me:

I can set .pane { top: 5px; bottom: 5px; }, and the pane is still hidden when it is not needed.

from nanoscrollerjs.

kristerkari avatar kristerkari commented on July 21, 2024

margin can now also be added since 712b871 so this is all fixed

from nanoscrollerjs.

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.