Manipulate Lightbox Caption with JS
-
Hi Armin,
i was fiddling around with the Lightbox caption and could not manage to manipulate it with JS. The caption itself looks like this:
<p class="custom-lightbox-caption">My Caption Text</p>
the JS:
<script> window.laytheme.on("newpageshown", function(){ jQuery('.sitetitle-txt-inner').parent().addClass('funny-test-class'); //Test if JS Works at all jQuery('.custom-lightbox-caption').addClass('funny-test-class'); //This does not work jQuery('.custom-lightbox-caption').parent().parent().addClass('custom-grid'); //This does not work jQuery('.custom-lightbox-caption').parent().addClass('custom-relative-caption'); //This does not work </script>
Is it not possible to manipulate the Lightbox with js this way?
Best
Felix -
hey sorry for the late reply
sorry dont have time to help you with custom code :/
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
Forgot your key, lost your files, need a previous Lay Theme or Addon version?
Go to www.laykeymanager.com