|
|
|
|
![]() ![]() |
Sep 5 2004, 08:58 PM
Post
#1
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 10 Joined: 5-September 04 Member No.: 1,025 |
Heare is a good trick:
Copy and paste the code below, into the <head> of your html document: CODE <script> function changeto(highlightcolor){ source=event.srcElement if (source.tagName=="TR"||source.tagName=="TABLE") return while(source.tagName!="TD") source=source.parentElement if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore") source.style.backgroundColor=highlightcolor } function changeback(originalcolor){ if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore") return if (event.toElement!=source) source.style.backgroundColor=originalcolor } </script> Now in the table write: CODE <table onMouseover="changeto('lightgreen')" onMouseout="changeback('white')"> of course you can put anny color. To exclude any cell(s) from the rollover effect, simply give that cell an id="ignore" CODE <table onMouseover=.... onMouseout=....> <td id="ignore"> and that`s it , if you have any questions ask me |
|
|
|
Sep 5 2004, 09:27 PM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 390 Joined: 22-August 04 From: No Where Member No.: 876 |
QUOTE(deedee2003 @ Sep 5 2004, 03:58 PM) Heare is a good trick: Copy and paste the code below, into the <head> of your html document: CODE <script> function changeto(highlightcolor){ source=event.srcElement if (source.tagName=="TR"||source.tagName=="TABLE") return while(source.tagName!="TD") source=source.parentElement if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore") source.style.backgroundColor=highlightcolor } function changeback(originalcolor){ if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore") return if (event.toElement!=source) source.style.backgroundColor=originalcolor } </script> Now in the table write: CODE <table onMouseover="changeto('lightgreen')" onMouseout="changeback('white')"> of course you can put anny color. To exclude any cell(s) from the rollover effect, simply give that cell an id="ignore" CODE <table onMouseover=.... onMouseout=....> <td id="ignore"> and that`s it , if you have any questions ask me *already knew* Its pretty neat...did I just use the word neat...*shoots himself*. On a side note: you have the smallest IP I have ever seen o_o |
|
|
|
Sep 5 2004, 10:20 PM
Post
#3
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 498 Joined: 23-August 04 Member No.: 878 |
Aye, that's awesome! Is there any way to make it dither or change colors like from white to gray smoothly?
|
|
|
|
Sep 12 2004, 07:35 PM
Post
#4
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 260 Joined: 12-August 04 From: Hurricane Alley, Florida Member No.: 770 |
yeah like make it fade from the two colors? or only possible in flash?
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 8th October 2008 - 05:39 AM |