Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By Lerura

Thread: How do I create a simple Popup descriptor (without link) on images

  1. #1
    New Coder
    Join Date
    Aug 2013
    Location
    Canada
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question How do I create a simple Popup descriptor (without link) on images

    I am creating a page for a group of friends for a betting pool on the World Cup. What I want is that the user can hover/mouse over each flag to see a popup of who is betting on that team.

    Obviously I need this to be simple, as I do not really relish the idea of creating an entire string of code for each and every team (32 in total).

    The style & such for the popups would be the same for each, the only difference being the names of the people betting on that team.

  • #2
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    947
    Thanks
    0
    Thanked 130 Times in 129 Posts
    The most simple would probably be to use the title attribute:
    Code:
    <script>
    function NewTitle(Team){
    FindBet=Team.id;
    TitleText='Users betting on '+FindBet+':';
      //code to find valid bets + add each matched name to TitleText by:    TitleText+='\n'+MatchedName;
    Team.title=TitleText;
    }
    </script>
    Code:
    <img src="France.png" id="France" onload="NewTitle(this);">

  • Users who have thanked Lerura for this post:

    Porthiir (06-18-2014)

  • #3
    New Coder
    Join Date
    Aug 2013
    Location
    Canada
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thank you so much, this works perfectly.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •