I'm using jQuery Tools Plugin as image slider (image here), but due to large amount of images I need to load them few at a time. Since it's javascript coded, I can't have the scroll position as far as I know. I want to load them as soon as the last image shows up or something like that. I have no idea where I put and event listener neither anything.
Here is my code http://jsfiddle.net/PxGTJ/
Give me some light, please!
First, you'll want to use jQuery for this
Second, put a placeholder on your page to contain your data.
You'll need to code your own GetData method in a webservice, but this is the general idea (And call Refresh(); from your page load)
The getData function variable is passed into the scrolltable plugin, it will be called as needed when the table is being scrolled. The callback and context are passed in, and used by the plugin to manage the object you are operating on (context) and the asynchronous nature of the web (callback)
The GetData (note the case) webmethod needs to return a JSON object that contains some critical information, how your server side code does this is up to you, but the object this plugin expects is the following. The Prior and Post data are used to trigger when to load more data, basically, you can scroll through the middle/active page, but when you start seeing data in the prior or post page, we're going to need to fetch more data
Next is the plugin itself
You'll likely need to tweak some things. I just converted it to a jQuery plugin and it's probably still a little glitchy.
I just had to use jQuery Tools' API, the
onSeek
parameter within thescrollable()
method.It was something like that
try something like this
OR find the
offset
location/position of the last image and try loading your content when you reach the offset position onscrolling
HTML :
some CSS :
Javascript :
here's a quick demo http://jsfiddle.net/8QbwU/
Though Demo doesn't met your full requirements, I believe It does give you
some light
to proceed further :)That could be made the following way:
That should do the trick.
EDIT: Because you're not using the native scroll, we've got to do a little fix to the code: