Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1164463
    Nikhil Ravishanker
    Participant

    Hi,

    I’m looking to add a hover effect to an image, where the image is in grayscale by default, but turns to color.
    Is there some way I can accomplish this?

    Thanks, in advance!

    #1164607
    Thai
    Moderator

    Hi There,

    #1] Please add the following CSS under Customizer > Custom > Global CSS:

    img.grayscale {
      filter: gray; /* IE6-9 */
      filter: grayscale(1); /* Microsoft Edge and Firefox 35+ */
      -webkit-filter: grayscale(1); /* Google Chrome, Safari 6+ & Opera 15+ */
    }
    
    /* Disable grayscale on hover */
    img.grayscale:hover {
      filter: none;
      -webkit-filter: grayscale(0);
    }

    #2] After that add the grayscale CSS class to the class field of your images:

    http://i.imgur.com/lC2olKW.png

    Hope it helps 🙂

  • <script> jQuery(function($){ $("#no-reply-1164463 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>