jquery-scroll icon indicating copy to clipboard operation
jquery-scroll copied to clipboard

Exception on scrollbar('scrollto', 'bottom')

Open deniskoronets opened this issue 9 years ago • 0 comments

Hey, guys! I've found an error in library: on 172 line

scrollto: function(to){
    return this.each(function(){    
        this.scrollbar.scrollto(to);
    });
},

if there are no enough content in my div, then scroll bar will be not enabled. So, if I call:

$('div').scrollbar();
$('div').scrollbar('scrollto', 'bottom');

, there are some trowed exception, cause this.scrollbar is undefined (or null, I don't know).

how I fix it:

scrollto: function(to){
    return this.each(function(){
        if (this.scrollbar !== undefined) {
            this.scrollbar.scrollto(to);
        }
    });
},

so after this fix it works excellent and don't throws an exception.

p.s. by English is not so good, as yours, I'm living in Ukraine.

deniskoronets avatar Mar 06 '15 09:03 deniskoronets