How to load jquery plugin on page load

I am trying to use this jQuery page slider plugin, here you can see a demo:

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

I can make it work, but it works when you click the link. I would like it to start automatically when they go to a specific page, is this possible? I am very new to this and searched google but couldn't find a solution.

Here is the demon from the demo above:

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

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

$ ("# slide-modal"). pageSlide ({width: "350px", direction: "left", modal: true});
+3
source share
1 answer

What I would do is load the page, dynamically click the link using jQuery.

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

This should make the script run on pageload.

+3
source

Source: https://habr.com/ru/post/1734449/


All Articles