Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link and ToolTipText

Status
Not open for further replies.

ISPrincess

Programmer
Feb 22, 2002
318
US
I am new to ASP and recently need to change the colors of a link on one of my pages based on some criteria.

I found the following code by john pollock on pageresource.com (which - by the way -was extremely helpful)


<HEAD>
<STYLE type=&quot;text/css&quot;>
<!--
.link1 A { color:green }
.link2 A { color:red }
-->
</STYLE>
</HEAD>


Then when I show the link and reference it I get the colors i need based on the criteria.

ie:
Response.Write(&quot;<TD><SPAN Class='link1'><a href='SomePage.asp?field=Field1&value=&quot; & sValue & &quot;' Target='_blank'>&quot; & sValue & &quot;</a></SPAN></TD>&quot; & vbCrLf)

This works fantastic - but I would like to add a tooltip to this link when the user hovers but I am not familiar with properties of this object within the above CSS.

I would think it is something like:

.link1 A:Hover { tooltiptext:&quot;This is a Green Link&quot; }


Can someone please help?

Thank you ahead of time.
 
jsut add the title to the href
Response.Write(&quot;<TD><SPAN Class='Link1'><a href='SomePage.asp?field=Field1&value=&quot; & sValue & &quot;' Target='_blank' title='This is a Green Link'>&quot; & sValue & &quot;</a></SPAN></TD>&quot; & vbCrLf)
hope I helped!
[roll2]
admin@onpntwebdesigns.com
 
To my knowledge there is no attribute for CSS that adds content to the page, CSS is for look and feel, not content. Adding tooltips is considered adding content. onpnt's suggestion is probably the simplest way to implement tooltips, the other needing a certain amount of client side code to handle them.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
I also know of no such attribute. In reference to what Tarwn is refering to. here's a example of what I think it is you are trying to accomplish. however as stated a large amoutn of client side coding compared to a simple title addition
<SCRIPT TYPE=&quot;text/javascript&quot; LANGUAGE=&quot;JavaScript&quot;><!--
function show(object) {
if (document.layers && document.layers[object] != null)
document.layers[object].visibility = 'visible';
else if (document.all)
document.all[object].style.visibility = 'visible';
}
function hide(object) {
if (document.layers && document.layers[object] != null)
document.layers[object].visibility = 'hidden';
else if (document.all)
document.all[object].style.visibility = 'hidden';
}
//--></SCRIPT>

<STYLE TYPE=&quot;text/css&quot;><!--
.myStyle {
position: absolute;
visibility: hidden;
}
//--></STYLE>
<A HREF=&quot;#&quot; onMouseover=&quot;show('myLayer2')&quot;
onMouseout=&quot;hide('myLayer2')&quot;>hover this</A>
<DIV ID=&quot;myLayer2&quot; CLASS=&quot;myStyle&quot;>
<TABLE BGCOLOR=&quot;#FFFFCC&quot;><TR><TD>
This text is hidden and when you hover over the link you get your tool tip as you called it
</TD></TR></TABLE>
</DIV>
hope I helped!
[roll2]
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top