1
我在引導中使用下拉和內容很高,所以我需要scrooll-y 但我不想使用瀏覽器默認滾動條,我使用→this script 此腳本工作正常,但是,當使用該腳本自舉下拉它不工作風格滾動在引導下拉菜單不起作用
此代碼爲我的自舉下拉菜單:
<button class="notify-bell dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"></button>
<div class="dropdown-menu notify_container" id="notify_container" aria-labelledby="dropdownMenu2">
<h1>...</h1>
<h2>...</h2>
<div class="action">
<img class="img-circle-notify" src="images/circle-avatar.png" alt="" title="">
<span class="user-message-row">....</span>
<span class="descript-notify">....</span>
<div class="notify-link">
<a class="" href="#">.....</a>
</div>
</div>
,這代碼初始化腳本:
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="js/jquery.jscrollpane.min.js"></script>
<script>
$(function() {
var bars = '.jspHorizontalBar, .jspVerticalBar';
$('.dropdown-menu .notify_container').bind('jsp-initialised', function (event, isScrollable) {
//hide the scroll bar on first load
$(this).find(bars).hide();
}).jScrollPane().hover(
//hide show scrollbar
function() {
$(this).find(bars).stop().fadeTo('fast', 0.9);
},
function() {
$(this).find(bars).stop().fadeTo('fast', 0);
}
);
console.log($('#notify_container'));
});
</script>
你也可以看到這個代碼的jsfiddle:http://jsfiddle.net/dbneke8b/
你能做出的jsfiddle PLS?我會更清楚。 –
什麼不工作? – Shehary
此jsfiddle http://jsfiddle.net/dbneke8b/ – sara