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

onmouseover & onmouseout in css

Status
Not open for further replies.

airswit

Programmer
Apr 19, 2003
23
US
i was wondering if there is any way to assign actions to the events in a style sheet. here is the situation, i have a page of thumbnails, and when user is over pic, i want window.status to be set to 'maximize', and when user gets off of pic, want it to go back to ''. i would love to do this without putting the tags in each a href tag, save a bunch of time

Code:
<a href="javascript:void(0)" onmouseover="window.status='Maximize'; return true; " onmouseout="window.status=''; return true;" onclick="openwind('pics/large/group.jpg',768,576)">
 
If IE only is alright, it sounds like DHTML Behaviors is exactly what you're looking for.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
i must be missing something, i don't see anywhere on that page that talks about what i want! just point me in the right direction, and i'll check it out myself.
 
Include in <HEAD>:
Code:
<STYLE>
   A{behavior:url(img.htc)}
</STYLE>

Contents of img.htc:
Code:
<PUBLIC:COMPONENT NAME="imgHandler">

<ATTACH EVENT="onmouseover" onevent="domouseover()" />
<ATTACH EVENT="onmouseout" onevent="domouseout()" />

<script language="JavaScript">
function domouseover(){
  window.status='Maximize';
  window.event.returnValue=true;
}
function domouseout(){
  window.status='';
  window.event.returnValue=true;
}
</script>

</PUBLIC:COMPONENT>


Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 

>> just point me in the right direction, and i'll check it out myself.

Adam did point you in the right direction... The link he gave enables you to get all the information you would need to implement behaviours.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top