RPTools.net

Discussion and Support

Skip to content

It is currently Sun Dec 17, 2017 12:46 pm 






Reply to topic  [ 5 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Cave Troll
 
Joined: Tue Sep 21, 2010 2:13 pm
Posts: 67
 Post subject: html tooltip over images
PostPosted: Wed Jun 26, 2013 10:45 pm 
How do I place a tooltip over an image.
For example, say I wanted the token name to show when I hover over the token image in the Chat window. How would the code for it look like?

TIA.


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3782
Location: MD
 Post subject: Re: html tooltip over images
PostPosted: Wed Jun 26, 2013 11:46 pm 
nirkedar wrote:
How do I place a tooltip over an image.
For example, say I wanted the token name to show when I hover over the token image in the Chat window. How would the code for it look like?

TIA.


You should be able to wrap the image in <span title="tool tip text"></span>.

If you're using broadcast, you'll have to convert the double quotes to single quotes.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Tue Sep 21, 2010 2:13 pm
Posts: 67
 Post subject: Re: html tooltip over images
PostPosted: Thu Jun 27, 2013 12:29 am 
The image shows (no prob), but the tooltip is still not showing.
What am I doing wrong?

CODE
[H: TokenID = ARG(0)]
[H: TokenName = getName(TokenID)]
[H: switchToken(TokenID)]
[H: ImageFile = strformat('<img border=0 src="%s" />', getTokenImage(60))]

<td style="padding:2px 2px; " align="center" width="100%"><span title='[R: TokenName]'>[R: ImageFile]</span></td>


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7969
Location: Bay Area
 Post subject: Re: html tooltip over images
PostPosted: Thu Jun 27, 2013 1:14 am 
Just going by memory, but for image tooltips, you may have to use the "alt" entity of the <img> tag rather than using <span> which is good for text. I just check some old code and yeah, that's what I did.

Code:
      [H: output = strformat('
         <table cellpadding="0">
            <tr>
               <td width="40" style="padding-right: 5px" valign="top"><img src="%{tokenImage}-40" alt="%{playerName}" /></td>
               <td style="margin-right: 5px; font-weight:700; " valign="top">%{tokenName}:</td>
               <td valign="top"><span>%{chatText}</span></td>
            </tr>
         </table>'
)]
 

_________________
Downloads:


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Tue Sep 21, 2010 2:13 pm
Posts: 67
 Post subject: Re: html tooltip over images
PostPosted: Thu Jun 27, 2013 4:57 am 
That did it for me.
Thanks a mil. 8)


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 5 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman