when i say
api.seekTo(10);
it moves the scrollbar
but that 10th item is not first item on that page
I want that , the item which is seeked should b the first item in the scrollable.
hope u understand !
any help will b appreciated .
function seekToPage(itemindex) {
var size = api.getConf().size,
// add size to avoid zero division
targetpage = Math.floor((itemindex + size) / size);
// subtract size revert to zero origin of array index
api.seekTo(targetpage * size - size);
}
function seekToPage(itemindex) {
var size = api.getConf().size, last = api.getItems().length - size;
if (itemindex < last) {
// not last page
api.seekTo(itemindex);
} else {
api.seekTo(last);
}
}
$("div.scrollable").scrollable({size: 3, api:true});
var api1=$("div.scrollable:eq(0)").scrollable({size: 3, api:true});
var api2=$("div.scrollable:eq(1)").scrollable({size: 3, api:true});
Posts: 1867
Registered:
Nov 16, 2007