Make div appear on Hover
-
Hello, I was trying to make a text appear when I hover on a picture, I could achieve that by using the JS code:
<script>
jQuery(document).on("mouseenter", ".hoverme", function(event) {
jQuery(".showme").show();
});
jQuery(document).on("mouseleave", ".hoverme", function(event) {
jQuery(".showme").hide();
});
</script>it works fine but the only problem is that the element with class .showme is visible when I load the page, then If I hover the other element and take off the mouse it disappear.
how can I make the element "showme" invisible when I first load the page?
thank you! -
Dear @beshepappà
you can use CSS classes to hide and remove the elements.Or call the function to hide ALL before you click.
Best!
Marius
I don't answer or check forum DMs, please just post on the forum.
Before you post:
Use the Search Feature. Maybe there is already a solution to your issue.
1. Update Lay Theme and all Lay Theme Addons
2. Disable all Plugins
3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
4. Now see if your problem solved itself
5. Go here, see if your problem is listed here:
Troubleshooting
When you post:
1. Post a link to where the problem is
2. If the problem is difficult to explain, post screenshots / link to a video to explain it