我正在尝试实现 jScrollPane。但是我的控制台中出现了许多错误。他们都是TypeError: $drag[0] is undefined. maxY = trackHeight - $drag[0].offsetHeight;
Scrollpane 正在识别 div - 它将它包装在 jScrollPaneScrollable 中并删除标准浏览器滚动条 - 但不应用它的滚动条或根本不允许我滚动,我在控制台中收到上述错误。
我的 HTML:
<div id="homePageOffersWindow">
<div class="homePageOffersContainer">
<div class="homePageOfferBlock">
<h3>HELI HIKES</h3>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. </p>
<p><strong>Save $23 per person</strong></p>
<div class="clear"></div>
<a href="#" class="stdButton whiteBlue">MORE DETAILS</a>
</div>
<div class="homePageOfferBlock">
<h3>HELI HIKES</h3>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. </p>
<p><strong>Save $23 per person</strong></p>
<div class="clear"></div>
<a href="#" class="stdButton whiteBlue">MORE DETAILS</a>
</div>
</div>
</div>
jQuery:
$('#homePageOffersWindow').jScrollPane();
CSS:
#homePageOffersWindow{height: 200px; overflow: auto}
.homePageOffersContainer{}
.homePageOfferBlock{margin:0 0 20px;}
.homePageOfferBlock:last-child{margin-bottom: 0}
有任何想法吗?