Skip to content

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

@deniskoronets

Description

@deniskoronets

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions