Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Make div appear on Hover

    General Discussion
    2
    2
    87
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      beshepappà last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • mariusjopen
        mariusjopen Global Moderator last edited by

        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

        www.mariusjopen.world

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Post a link to where the problem is
        I don't answer or check forum DMs, please just post on the forum.
        Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com

        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

        Thanks!

        Online Users

        L
        Q

        Recent Topics

        • L

          Product Categories/Tags Filters

        • ajax doesn't change body classes (and maybe more)

        • cart layout / big vertical menu conflict

        • back to home from any project should not go back to top at home

        laytheme.com