开发者

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

开发者 https://www.devze.com 2022-12-11 17:02 出处:网络
I need help. I have got开发者_如何学C 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 re

I need help. I have got开发者_如何学C 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(); });


$(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. :)

0

精彩评论

暂无评论...
验证码 换一张
取 消