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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Rollover 1

Status
Not open for further replies.

JBell99

Programmer
May 28, 2001
31
0
0
US
Ok, I need to have my texy have a small icon appear when people roll over it. For example..... browse over their link for the Forums, Guest Book, FAQ, and contest. As you see, a small selection hand appears beside the words. I looked at the source of the page, but i can't figure it out. I know it's javascript. I need to have that exact effect but i am going to use a different icon. If i have to put the code in every where i want it to appear than thats fine.....but, i rather have it in my style and have it come up by all links when rolled over. By the way, i am not using a side bar or anything like that, i know how to do a code simialr to this with a side bar..but this is a lot better in my opinion. Can someone fill me in on how to do it?
 
It's just a simple image rollover, so can't be done using styles. The onMouseOver event of the hyperlink calls the Arrow function to swap a blank image with the image of the hand. Have a look at the code again to see if you can figure it out (although it's not well presented).

Here's the rollover function
Code:
function Arrow(Arrowname) {

  if (isIMG) {
    document[Arrowname].src = (document[Arrowname].src.indexOf('disk.gif') != -1) ? 'del.gif' : 'disk.gif';

  }

}
And the HTML for the link. As you can see, it starts with del.gif (which is a blank image). The mouse events just swap that image.
Code:
<img src=&quot;del.gif&quot; width=&quot;2&quot; height=&quot;15&quot;><b><a onMouseOver=&quot;Arrow('Forums')&quot; onMouseOut=&quot;Arrow('Forums')&quot; class=&quot;menu&quot; href=&quot;[URL unfurl="true"]http://finalgamers.hypermart.net/cgi-bin/ikonboard/ikonboard.cgi&quot;><font[/URL] face=&quot;Verdana&quot; size=&quot;1&quot;>Forums</font></a>
Greg.
 
Thanks Greg, I think I understand it now. I guess all i can do now is insert the code and see if it work :)

and..BTW, you got my vote. Jeremy Bell -
Webmaster of
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top