问题
code updated : http://mawk3y.net/test/brand.php?id=12
the original jquery plugin is here http://manos.malihu.gr/tuts/jquery_custom_scrollbar.html
$(".content1").mCustomScrollbar({
scrollButtons:{
enable:true
}
});
$("#contact_details").mCustomScrollbar({
scrollButtons:{
enable:true
}
});
.content1 is the div with the problem : custom scrollbar doesn't show up untill you resize the window or start firebug and contact_details is the div inside the first tab which is without any problem though both divs contain text only."
回答1:
The problem is your
$(window).load(function(){
is inside your
$(document).ready(function(e) {
Remove the document ready function if your going to have images inside this div. Otherwise Remove the window load function. You won't need both.
回答2:
Your inline CSS for the scroll bar within #content_11
has display:none
set.
<div class="mCSB_scrollTools" style="position: absolute; display: none;"> ... </div>
When you re-size the page, the plug-in is overwriting that element, which makes it appear. By manually replacing display: none
with display: block;
in my browser, I can make the scroll bar appear (albeit in the wrong place).
Your functional div, #contact_details
has display: block
already.
<div class="mCSB_scrollTools" style="position: absolute; display: block;">...</div>
来源:https://stackoverflow.com/questions/14489518/stubborn-prolem-with-popular-custom-scrollbar