Tracing Carousel events
-
Hello,
I want to build a carousel slider, when somebody is on the last slide and willing to proceed "clicking NEXT", he will be referred to a different page instead of to the beginning of the slider.Is there any possibility to trace the "CLICKING NEXT" event on the last slide of a carousel?
Many thanks,
Sasha -
Dear @spontans
This one require's a deeper understanding of JS/ jQuery, and after inspecting a little bit i'm quite sure it's possible,
I apologise that i cant take you through the whole thing however but am happy to set you off in the right direction, if things prove too difficult you may wish to seek the aid of a developer to achieve this task:
The Carousel cannot be set to "loop" otherwise this will not work -
When the Carousel wrapper reaches it's last slide a class "hide-next-related-ui" gets added that prevents us from going further:
but this is good news! as we can take this action and build upon it.
Using jQuery we can wait for the element to exist:
( google searches are so long... )
And then once it exists we can add a class:
https://www.w3schools.com/jquery/html_addclass.aspAnd this could do anything you wish, make an image appear - make a link appear, change the color of something etc etc
Additionally if the Class "hide-next-related-ui" were to not exist anymore because you moved the carousel back to previous slides then its important that our new content would then also disappear as well.
It's a bit of a tricky one but is possible!
Apologies once again that i am unable to help you with deeper customisation,
Best wishes & good luck
Sincerely
Richard -
Dear @spontans
This one require's a deeper understanding of JS/ jQuery, and after inspecting a little bit i'm quite sure it's possible,
I apologise that i cant take you through the whole thing however but am happy to set you off in the right direction, if things prove too difficult you may wish to seek the aid of a developer to achieve this task:
The Carousel cannot be set to "loop" otherwise this will not work -
When the Carousel wrapper reaches it's last slide a class "hide-next-related-ui" gets added that prevents us from going further:
but this is good news! as we can take this action and build upon it.
Using jQuery we can wait for the element to exist:
( google searches are so long... )
And then once it exists we can add a class:
https://www.w3schools.com/jquery/html_addclass.aspAnd this could do anything you wish, make an image appear - make a link appear, change the color of something etc etc
Additionally if the Class "hide-next-related-ui" were to not exist anymore because you moved the carousel back to previous slides then its important that our new content would then also disappear as well.
It's a bit of a tricky one but is possible!
Apologies once again that i am unable to help you with deeper customisation,
Best wishes & good luck
Sincerely
Richard -
@Richard-Keith said in Tracing Carousel events:
Dear @spontans
This one require's a deeper understanding of JS/ jQuery, and after inspecting a little bit i'm quite sure it's possible,Hi Richard,
Thanks so much for taking your time and finding a hook for me!
It seems that I can manage to do it by myself.. will try now.
Thanks
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it