Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data attribute upon the loading of lSPager. Continues to get overwritten. #484

Open
bradthebluefish opened this issue Feb 6, 2023 · 1 comment

Comments

@bradthebluefish
Copy link

Looking to add a data attribute and/or CSS class to the lSPager thumbnails. My attempts to do so using the current callbacks work for a split second but are then overwritten. Perhaps there should be a new callback? Say onPagerLoad?

@bradthebluefish bradthebluefish changed the title Add data attribute upon the loading of lSPager. Currently overwritten. Add data attribute upon the loading of lSPager. Continues to get overwritten. Feb 6, 2023
@larrynalzaro
Copy link

larrynalzaro commented Mar 14, 2024

Add a setTimeout to 500ms or 800ms. Add like this:

$("#slider").lightSlider({ item: 1, onSliderLoad: function(el) { setTimeout(()=> { ... do your CSS }, 500); }, });

You must wait until the widget is fully rendered before adding your new attributes. Hence, wait for half a second before doing so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants