Detect slide position in Jquery SLY plugin

Asked

Viewed 35 times

0

Hello. I wonder how I detect the current position of a slide using the Sly plugin.

The kind I use is 'oneperframe'. I don’t have much knowledge of jquery, and even less with this plugin. I visited http://darsa.in/sly/#! Documentation but it was not very didactic. ....

In case no one knows, but is aware of a slideshow (by HTML content and not just images) similar to the one in which I can detect the slide position every time I change(onscroll), it is also welcome. thank you.

  • Yes, but I tried to implement it in several ways. The closest q was to run an Alert (replacing the.log console) only once (onload). What I wanted is something like an eventlistening, every time the user moves the slide, return the value of the slide in display.

  • That’s the link I showed you: change event. Edit the question and include the code of what you have tried, even if it is wrong. So you can provide an answer from your code.

1 answer

0

On my own I made it. I tried and tried and found a piece of the original code that runs every slide change.

1. Go to the archive Sly.minjs.. Find the following excerpt:

(e&&(a=Ib[d.centerItem].center),Pb&&Rb.activateMiddle&&T(d.centerItem):e&&(a=Ib[d.firstItem].start)}

2. In that final part, start)}, before the } put ; and enter its function. I have identified two variables, Jb.activeItem and Sb.pos. I did the following: ....firstItem]. start); function(Jb.activeItem);}

This part is executed at each movement, that is, in real time. In a single slide change, this section is executed dozens of times. Therefore, whoever wants to use, will have to create a control function, to execute a command only when there is a slide change (Jb.activeItem). Okay, the hard part is already solved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.