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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login