jScrollPane 2.0 height problem in chrome

橙三吉。 提交于 2019-12-03 06:11:13

Did you also test in Safari? This sounds like an issue that occurs in Webkit when the javascript is included before the CSS in the head of the document: http://jscrollpane.kelvinluck.com/faqs.html#webkit-broken

If that isn't the cause then it might be something related to the fact that you have an image in your scrollpane. You need to either include the width and height of the image (see http://jscrollpane.kelvinluck.com/image2.html) or autoReinitialise the pane (see http://jscrollpane.kelvinluck.com/image.html).

Hope it helps :)

Felix A J

give the call to jscrollpane in $(window).load instead of $(document).ready

I have also discovered that adding a css rule to .scroll-pane for line-height solves my height issues.

For example:

.scroll-pane {line-height: 1;}

or whatever line height your content may need.

I also discovered that if you use @font-face, jscrollpane may do the height calculation before your font has properly loaded, and therefore miscalculate. I fixed this by adding the setting:

autoReinitialise: true

It runs on a timer though so use thoughtfully.

If you have image inside your jScrollPane div area, simply define its width and height.

<div class="scroll-pane">
<img src="image.jpg" alt="" width="300" height="50" />
</div>

That will fix the jScrollPane's webkit bug. Oh and of course load the CSS before JS

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!