Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Adding Text and Image to Hover-over in Perl

Hi,

i am using the following Perl script to add for 2 different languages text + Hover-over text.

[% Begin Unverified Perl
if(GETVALUE("SD1") ==1)  
{  
return ' <span class="tool_tip_link" style="font-weight:normal; color: #2f469c;" title="Hoover-over text"> Regular text</span> ' ;
}
if(GETVALUE("SD1") ==2)  
{  
return ' <span class="tool_tip_link" style="font-weight:normal; color: #2f469c;" title="Hoover-over text">Regular text</span> ';
}
End Unverified %]

However, i would need to add an image to the hover-over text as well, but am not sure how i should do this.

many thanks
Tina
asked Feb 19 by Tina Van Regenmortel (265 points)

1 Answer

0 votes
Take a look at this post as I believe it will give you what you are looking for.

https://legacy.sawtoothsoftware.com/forum/25579/return-image-with-hover-over-box-within-perl?show=25579#q25579
answered Feb 19 by Jay Rutherford Gold (41,660 points)
Hi Jay, that post gives me an image, with text as hover-over. What i need is text, with text+image as hover-over. Could you tell me how i can change the script in the post you refer to to what i need? Can i just add a "toolTip3"? How will the script know that i need both the text+image as hover-over?
Sure, you just add the text in front of or behind the image tag.  See my example below for text before and after the image.

So this: '<img src="' . GRAPHICSPATH() . 'Betrouwbaarheid_90.png"/>'

Would be changed to this: 'This text will now show before the image <img src="' . GRAPHICSPATH() . 'Betrouwbaarheid_90.png"/> This text will now show after the image'
...