Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
deniskoronets opened this issue Mar 6, 2015 · 0 comments
Open

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

deniskoronets opened this issue Mar 6, 2015 · 0 comments

Comments

@deniskoronets
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant