Home Forums WoodMart support forum Remove image alt title text on hover

Remove image alt title text on hover

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #62201

    wizard247
    Participant

    Hi,

    I am using this function to remove the hover alt/title text on the product images but for some reason it is not working in Woodmart. Can you check what’s wrong with this function please?

    /*----------------------------------------
    // Remove Image Title on hover
    //--------------------------------------*/
    
    function removeImageTitleOnHover(){
    ?>
    <script>
        jQuery(document).ready(function() {              
    		var imgTitle;
    		jQuery("img").hover(function(){
        		imgTitle = jQuery(this).attr("title");
        		jQuery(this).removeAttr("title");
    		}, function(){
       		jQuery(this).attr("title", imgTitle);
    		});
     	});          
    </script>
    <?php
    }
    add_action('wp_footer', 'removeImageTitleOnHover');

    It’s the hover over the thumbnails in the gallery – see here: https://ugames.com.au/product/kids-18pc-tinned-game-asst/

    Thank you in advance!

    #62205

    Artem Temos
    Keymaster

    Hi,

    We just checked your website but don’t see the code in the page source. Did you add it already?

    Regards

    #62207

    wizard247
    Participant

    I temporarily disabled it as I was not seeing any Titles in the backend. I just want to remove them from the hover, not in the backend due to SEO usage.

    #62217

    Artem Temos
    Keymaster

    So the code works with all images except product page? Please, add it now so we can check what is wrong there.

    #62359

    wizard247
    Participant

    I had put it back but it was doing nothing, so I found an (old) plugin that seems to do the trick – it removes the title attribute completely but keeps the alt attribute.

    #62373

    Artem Temos
    Keymaster

    OK, we are glad that you sorted this out.

Viewing 6 posts - 1 through 6 (of 6 total)