Hide title attribute on hover, but don’t remove

9 Comments

  1. Emil

    and this ?
    $( \”a\” ).hover(
    function() {

    // Get the current title
    var title = $(this).attr(\"title\");

        // Store it in a temporary attribute
        $(this).attr(\"tmp_title\", title);
    
        // Set the title to nothing so we don\'t see the tooltips
        $(this).attr(\"title\",\"\");
     }, function() {
        // Retrieve the title from the temporary attribute
        var title = $(this).attr(\"tmp_title\");
    
        // Return the title to what it was
        $(this).attr(\"title\", title);
     }
    

    );

  2. This was a much needed workaround, and really smooth.
    I changed it to be on(mouseover) and on (mouseleave) to fire the functions.

    Well done.

    1. Glad you found it useful Ryan. Cheers!

  3. Michael T.

    Can I ask how you implement this? Is this placed in the PrettyBox java script or is there a way to run it from the short code? I’ve been pounding my head over this problem for days now.

    1. If you can, add the JS to the theme files. If you’re not able to do that, you’d need to add it using an ‘additional javascript’ plugin. I haven’t used these before so I can’t recommend any one in particular. Reach out on our chat system if you want more help, I’ll see what I can do.

  4. Myhindipoint

    Nice

  5. Ayush Mandowara

    Thanks, just what I was looking for!
    I was facing an issue where I needed to disable the tooltip, but removing the title attribute ended up changing the functionality of the button, it was no longer sending data. Apparently

  6. Julia

    Hi! Many thanks for the code! I’m trying to use it but I don’t know exactly which elements of the code I have to replace to adjust it to my site. Do I have to put the class of the image on “.element” ? Do I have to change something else? Sorry for beeing such a Dummie and thanks again!

    1. Hi Julia. You can change .element to which ever target you need. Adding a class to the image using this script should also do it though, yes.

Leave a Reply to Bryan Hoffman Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.