ddmnet / jScroll

iScroll plugin for jQuery
MIT License
20 stars 31 forks source link

iScroll.refresh() -is there a way to get access to the actual iScroll class? #1

Closed imranansari closed 12 years ago

imranansari commented 12 years ago

I use the refresh method often when data gets updated in iScroll, any idea on how to do that using this plugin?

thanks.

imranansari commented 12 years ago

I ended up accessing iScroll form the iScrollers array

iScrollers[0].instance.refresh();

jacks-teamddm commented 12 years ago

Would something like: $("#jscrolled_element").jScroll("refresh") be useful? I'll also look at having the jScroll() call return the instance.

imranansari commented 12 years ago

returning the instance would be great. thanks for the plugin, it cleaned up my code a lot.

jacks-teamddm commented 12 years ago

After looking at the code a bit this morning, I realized that it won't be possible to return the instance without breaking the chain-ability of the plugin. There are a number of other issues with that approach (what instance do you return if the selector is applying jScroll to multiple elements?), so I'm just going to leave it the way it is. Best of luck in your coding adventures!