I have a JS code like this below:
$(window).resize(function () {
if ($('.scrollbar-y').length) {
$('.scrollbar-y').tinyscrollbar_update('relative');
}
if ($('.scrollbar-x').length) {
$('.scrollbar-x').tinyscrollbar_update('top');
}
});
at $('.scrollbar-y').tinyscrollbar_update('relative');
this line it's showing
Uncaught TypeError: Cannot read property 'update' of undefined
So How to check TinyScrollBar is initialized or not with .scrollbar-y
div ?
If I write:
$(window).resize(function () {
if ($('.scrollbar-y').length) {
$('.scrollbar-y').tinyscrollbar();
$('.scrollbar-y').tinyscrollbar_update('relative');
}
if ($('.scrollbar-x').length) {
$('.scrollbar-x').tinyscrollbar();
$('.scrollbar-x').tinyscrollbar_update('top');
}
});
It's showing
Uncaught TypeError: Cannot read property 'offsetHeight' of undefined