gareth
gareth

Reputation: 189

JQUERY: scrollTo: On page load goto 'x' div tag to the right

I need help. I have got a scroller working with next back buttons scrolling the div tags within 'scrollable' but I need to automatically jump to a div tag when the page is loaded or reloaded i.e. start at the 5 div tag along. is this possible? my code/example link below

$(function() { $("div.scrollable").scrollable(); });

Upvotes: 0

Views: 1062

Answers (1)

no1cobla
no1cobla

Reputation: 94

$(function() { 
    $("div.scrollable").scrollable();
    var api = $("div.scrollable").data("scrollable");
    api.move(4); // moves the scroller 4 places
    // or: api.seekTo(5); goes directly to index set.
});

Havent tested, but on the site you can lookup the api functions. This should work. :)

Upvotes: 1

Related Questions