Imagehover on Element Grid + Lightbox on Carousel
-
I have read a couple of things about that but I am not sure and I was wondering if there is the possibility to use the image hover plugin on the Element Grid and the Lightbox option on the carousel slideshow.
If not, is there a possibility to code it? Thanks in advance!
-
Dear @rioma7
You are correct that currently the Imagehover function works separately from the Element Grid, as well as the mix of Lightbox & Carousel.
However i wish to help and set you in the right direction :)
This workaround will require some basic knowledge of HTML, CSS and a little JS.
We can add Custom Code through 'Lay-Options - Custom CSS & HTML' in the admin panel.
We must remember that any JS, jQuery added to Lay Theme is done by wrapping it in a 'newpage event':
https://laytheme.com/documentation.html#custom-javascriptAnd some info on CSS & Developer tools if needed:
https://www.khanacademy.org/computing/computer-programming/html-cssOk :)
So within the Element Grid we can choose some example text, Add the desired link and then go into "Source Code"
Here within the Link tags <a> we can add a class called whatever we wish - i called mine 'special' :
& now on our frontend we can see that indeed the link now has a class that we can target called 'special' :
Now we need to create an image separately ( the downside to this option sorry ), Then i can right click the image in the gridder and set a Custom Class or ID to it:
I named mine 'magical' and indeed it has shown up:
Now we need to go to "Lay-options-Custom CSS & HTML" and add some code like this for example:
.magical { display: none; } .magical.cool{ display:block !important; }
Now with jQuery: When we Hover over "special" a class called 'cool' gets added to "magical"
jQuery(".special").hover(function () { jQuery(".magical").toggleClass("cool"); });
We must set the common ( $ ) sign to ( jQuery ) with wordpress.
Our Image that was invisible is now made visible when you hover over your text.
As for Styling the Image how you wish that is up to you and your design needs :)I hope this Helps, Best of luck in your Lay Theme Journey and have a wonderful day
Best
Richard -
Hi,
I just recently purchased the Image Hover plug-in which works in the gridder but not when I'm using Element Grid. I now see here that currently this function doesn't work with Element Grid but was wondering if this was something that you were working on at all?
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