Reputation: 11
I am using the tinyScrollbar Jquery plugin http://baijs.nl/tinyscrollbar/ on a div which is on page load has display:none so i have to use the update method when it is made visible (as the documentation says) but the update method is not working.. here is the code:
$("#list-scrollbar").tinyscrollbar();
$(".playlist-drop-btn").click(function(){
$(".audio .drop").slideToggle(200);
$(".playlist-drop-btn").toggleClass("up");
$("#list-scrollbar").update();
});
note: when I make the div on page load display:block it works correctly.
Upvotes: 1
Views: 9760
Reputation: 1
var $scrollbar= $('#list-scrollbar');
$scrollbar.tinyscrollbar();
var scrolbar1=$scrollbar.data("plugin_tinyscrollbar");
scrollbar1.update();
Upvotes: -1
Reputation: 1752
The function you need to call is tinyscrollbar_update()
$("#list-scrollbar").tinyscrollbar();
$(".playlist-drop-btn").click(function(){
$(".audio .drop").slideToggle(200);
$(".playlist-drop-btn").toggleClass("up");
$("#list-scrollbar").tinyscrollbar_update();
});
It is listed on the homepage at the very bottom: http://baijs.nl/tinyscrollbar/
Upvotes: 3
Reputation: 11
You should do this:
var oScrollbar = $("#list-scrollbar");
oScrollbar.tinyscrollbar();
$(".playlist-drop-btn").click(function(){
$(".audio .drop").slideToggle(200);
$(".playlist-drop-btn").toggleClass("up");
oScrollbar.update();
});
Upvotes: -1