How to load jquery plugin on page load
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.
精彩评论