set auto grid slide in jquery.gridnav.js

342 views Asked by At

http://tympanus.net/Development/GridNavigationEffects/example10.html

http://tympanus.net/Development/GridNavigationEffects/js/jquery.gridnav.js

I want same effect for grid slide but to see that effect we have to click on previous & next icon but I want it automatically after page load.

Also, when we reach last row it should start again from first slide automatically.

1

There are 1 answers

4
Parag Bhayani On

Let's take one question at a time

For the first part you want to work it automatically, So you can do one thing, Programatically call click event on the next button.(You can also hide the button with css if you don't want it to visible to users) This is the code for that

$( document ).ready(function() {
    setTimeout(function(){ 
        $('#tj_next').trigger('click'); 
    }, 2000);// Every 2000 miliseconds, i.e. 2 seconds it will show next page
});

Here you can pass id of the next and previous clicks with settings aswell, by default it is 'tj_next'

If you want to call it periodically then you can use window.setTimeout for that aswell