You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a sort of newbie to js and I was wondering if the following is possible?
If I make a link on one page, and when clicked/touched on, I want it to go to a certain li element. So not next or previous but for example 3 slides further, how do I do this and is this even possible?
I guess I have to name the li elements and change something in the onclick?
Hope someone can help me!
Regards,
Lizzie
The text was updated successfully, but these errors were encountered:
You can jump to a specific element, based on its index.
The Swipe API provides the .slide(index, duration) method.
You'd use it like this:
// considering #slider has an UL list as a fist child node. varmySwipe=newSwipe(document.getElementById('slider'));// the button that makes the jump when clickedvartheTrigger=document.getElementById('trigger');// handle the "onclick" event nicelytheTrigger.addEventListener("click",function(){// jump to the 4th LI element (4th, because it's a zero-indexed array)// animate across 500 millisecondsmySwipe.slide(3,500)})
Hi there,
I'm a sort of newbie to js and I was wondering if the following is possible?
If I make a link on one page, and when clicked/touched on, I want it to go to a certain li element. So not next or previous but for example 3 slides further, how do I do this and is this even possible?
I guess I have to name the li elements and change something in the onclick?
Hope someone can help me!
Regards,
Lizzie
The text was updated successfully, but these errors were encountered: