我正在尝试实现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}
有什么想法吗?
答案 0 :(得分:1)
尝试调用jquery 1.4.2而不是jquery版本
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>