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

onhover in stylesheet

Status
Not open for further replies.

thakral

Technical User
Sep 6, 2002
16
TH
Hi all

I need to create a link which on click redirects to a page 'aa.htm' and on hover shows a small window pulling information from 'bb.htm' . The problem is that this has to be achieved using stylesheets.

My stlesheet looks like below

stylename {
link_prefix : "<a target=_blank href=aa.htm";
link_suffix : "</a>";
}

With this i am able to accomplish the onClick redirect to 'aa.htm'.

Question --
Anyone has any idea how can i accomplish onHover part.
Or can anyone suggest how can i accoplish something like
onHover -call Javascript:doit() and i can insert the commands to pull 'bb.htm' inside javascript doit()

Thanks
 
you need to use HTC
to your style sheet add:
Code:
behavior : url(myHoverBehavior.htc);

then create a file called myHoverBehavior.htc in which you add:
Code:
<PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="OnMouseOver()" />
<PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="OnMouseOut()" />

<SCRIPT LANGUAGE="JavaScript">

function OnMouseOver()
{
   // code for when mouse gets over the element
}

function OnMouseOut()
{
   // code for when the mouse leaves the element
}
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top