开发者

How to load jquery plugin on page load

开发者 https://www.devze.com 2022-12-21 11:58 出处:网络
Im trying to use this page slider jquery plugin, you can see the开发者_C百科 demo here: http://www.derekperez.com/jquery-pageslide/demo/

Im trying to use this page slider jquery plugin, you can see the开发者_C百科 demo here:

http://www.derekperez.com/jquery-pageslide/demo/

I can get it to work, but it works when you click a link. I would like to make it automatically run when they go to a certain page, is this possible? I am very new to this and searched google but couldnt find a solution.

Here is the jist from the demo above:

<script type="text/javascript" src="/javascript/pageslider/jquery.pageslide.js"></script>

<(link goes here, can only post 1 link) id="slide-modal">PageSlide as a modal element

$("#slide-modal").pageSlide({ width: "350px", direction: "left", modal: true });


What I would do is on page load dynamically click your link using jQuery.

$(document).ready(function() { 
    $("#slide-modal").pageSlide({ width: "350px", direction: "left", modal: true }); 
    $('#slide-modal').click();
});

That should make the script run on pageload.

0

精彩评论

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

关注公众号