views:

90

answers:

1

Im trying to use this page slider jquery plugin, you can see the 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 });
+2  A: 

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.

nickohrn
Gah, you beat me to it by about 45 seconds. That's definitely the easiest way to do this.
ehdv
Thank you, that worked!
John
@John - If this is the solution to your problem, you should accept the answer, so that someone searching on the same thing knows what worked for you. :-)
Buggabill