The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
2 posters

    Hover-over text

    Anzo
    Anzo
    Forumember


    Posts : 358
    Reputation : 8
    Language : English/Arabic
    Location : Baghdad - Iraq

    Hover-over text Empty Hover-over text

    Post by Anzo March 22nd 2016, 2:46 pm

    I have an image and I want to add a paragraph that can show up when I hover over the image.

    Also, can it be done like a pop up? You hover over and when you click or something you get a pop up that has a paragraph or something.
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Hover-over text Empty Re: Hover-over text

    Post by Ange Tuteur March 22nd 2016, 3:17 pm

    Hmm.. you could use this plugin I wrote to install a popup module.

    Then an example of what you could do with it ;

    HTML :
    Code:
    <img id="popup-paragraph" src="http://i84.servimg.com/u/f84/18/21/41/30/vash10.png"/>

    JavaScript using the popup :
    Code:
    $(function() {
      var img = document.getElementById('popup-paragraph');
      if (img) {
        img.onclick = function() {
          FA.Popup.open('', 'Popup Example', function(popup) {
            popup.innerHTML = 'Hello world !';
          });
        }
      }
    });
    Clicking the image should open a popup with the text : "Hello world !"

    The API for the popup is in the second post : https://help.forumotion.com/t143260-a-popup-module-for-your-forum#976021

      Current date/time is September 22nd 2024, 5:30 pm