Closed Thread Icon

Preserved Topic: TR mouseover/mouseout code (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18448" title="Pages that link to Preserved Topic: TR mouseover/mouseout code (Page 1 of 1)" rel="nofollow" >Preserved Topic: TR mouseover/mouseout code <span class="small">(Page 1 of 1)</span>\

 
Boudga
Maniac (V) Mad Scientist

From: Jacks raging bile duct....
Insane since: Mar 2000

posted posted 08-14-2002 18:24

I would like to use CSS to define a javascript action for mouseover/mouseout functions on a Table Row...can anyone point me to a explanation on how to do this so that I can automatically have this done instead of manually placing the code for each TR created?

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 08-14-2002 20:14

I haven't heard of that being done. If it can be, I'd REALLY be interested to see how!

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 08-14-2002 20:46

do you mean the same effect, that phpmyadmin has?

copy and paste from there:
<BLOCKQUOTE><FONT face="Verdana, Arial">code:</font><HR><pre><tr onmouseover="setPointer(this, '#CCFFCC', '#CCCCCC')" onmouseout="setPointer(this, '#CCCCCC', '#CCCCCC')">


<script>
function setPointer(theRow, thePointerColor, theNormalBgColor)
{
var theCells = null;

if (thePointerColor == ''

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 08-14-2002 21:29

why would you *want* to?


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 08-15-2002 00:53

If it's what I'm thinking, he wants to basically tie a javascript function to a CSS class. That way, you don't have to hard code the function calls within the <tr> tags.

Boudga
Maniac (V) Mad Scientist

From: Jacks raging bile duct....
Insane since: Mar 2000

posted posted 08-15-2002 02:48

Yeah that's the ticket! Thanks Grumble!!!!

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 08-15-2002 03:53

see, I get why he would want the dynamicy of it, just wondering why create an event onmousever of a Table Row..


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

Boudga
Maniac (V) Mad Scientist

From: Jacks raging bile duct....
Insane since: Mar 2000

posted posted 08-15-2002 08:21

I have a site with numerous TR's and most of the viewers are older...I was thinking it would be a visual aid for readability

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 08-15-2002 08:55

hey grumble, nice code.
thanks for sharing.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 08-15-2002 11:30

np, but as i said above, this is just copied and pasted from the phpmyadmin source.

hecster2k
Nervous Wreck (II) Inmate

From: sj, ca, usa
Insane since: Feb 2002

posted posted 08-15-2002 18:47

here's some similar code i made. i also added a "cursor:hand" attribute to the sideNavLink class in the css:

code:
<tr><td class="sideNavLink" onmouseover="hili(this)" onmouseout="unHili(this)" onClick="changePage('index.jsp')"><a class="sideNavLink" href="index.jsp">home</a></td></tr>
<script>
function hili(row)
{
row.style.background = "B4C7E8";
row.style.color = "3969AA";
}
function unHili(row)
{
row.style.background = "3969AA";
}

function changePage(page)
{
document.location.href = page;
}
</script>



"there has to be a solution."

« BackwardsOnwards »

Show Forum Drop Down Menu