Okay
  Public Ticket #2249750
Image swap on hover
Closed

Comments

  •  2
    whisper started the conversation

    Hello,


    I am trying to find a widget that allows me to have a simple image swap on hover.  ?    Can you tell me how to do this with your theme please?

  •  2
    whisper replied

    Also.. using the 'SiteOrigin Editor' widget, how can I center a title, some of my widgets are fine to have the title 'left aligned' however a couple need to have 'center aligned' titles :)

  •  1,710
    Barry replied

    Hi there,

    There is no specific widget for this but you can easily create this by adding a "Custom HTML" widget to the page builder and follow these steps:

    1. Add a custom div to the textarea:

    <div class="image-swap"></div>

    2. Navigate to Appearance -> Customize -> Additional CSS and add the following:

    .image-swap {
        width: 100%;
        height: 200px; // Change this to your own needs
        background-repeat: no-repeat;
        background-size: contain;
    }
    

    Then add the following line to add the default image:

    .image-swap {
        background-image: url('http://example.com/image.png');
    }
    

    And the following line to add the hover image:

    .image-swap:hover {
        background-image: url('http://example.com/image-hover.png');
    }
    

    ---

    To center the widget titles you can add "text-center" (without " ") in the Widget Class input field inside the Attributes panel 

    Best regards,
    Barry
    QreativeThemes.com  |  WordPress Themes

  •  2
    whisper replied

    Thank you for these solutions, i'll try them now :)

    Thanks again for the assistance :)

  •  1,710
    Barry replied

    You're welcomesmile.png

    If you have any other questions please let me know 

    Best regards,
    Barry
    QreativeThemes.com  |  WordPress Themes