CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 22nd, 2004, 03:53 PM
sbenzies sbenzies is offline
Webmaster
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Langley, BC, Canada
Posts: 14 sbenzies User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sbenzies
onmouseover column bg change

I am trying to find a script so that when you mouseover any element in a standard table the entire column background color will change. Doing this with individual cells and even row bg changes is easy, though I am having problems with entire column changes. Any help?

Reply With Quote
  #2  
Old July 22nd, 2004, 05:06 PM
TheJim01's Avatar
TheJim01 TheJim01 is offline
Coconuts migrate?
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: http://middle.nowhere.com
Posts: 1,894 TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)  Folding Points: 67725 Folding Title: Intermediate FolderFolding Points: 67725 Folding Title: Intermediate FolderFolding Points: 67725 Folding Title: Intermediate FolderFolding Points: 67725 Folding Title: Intermediate Folder
Time spent in forums: 2 Weeks 5 Days 10 h 4 m 38 sec
Reputation Power: 1173
This one's gonna be tricky. First, I'd set the id of each cell according to its row and column. For example "r0c0" would be row 0, col 0, and "r3c5" would be row 3, col 5, etc. Now, in your javascript, you'll need to loop through, changing the specific elements. Something like this:
PHP Code:
<script type="text/javascript">
<!--
function 
changecol(colnum){
  var 
el ""// "" makes it a string...
  
var MAXROWS 10// the number of rows you have in your table
  
for(var 0MAX_ROWSi++){
     
el "r" "c" colnum;
    
document.getElementById(el).style.backgroundColor '#CCCCCC';
  }
}
// -->
</script> 


Seems right in my head...

[edit]
Apparently "in my head" wasnt' so good. I fixed my code though...
Thre's a slightly easier way to do it, but this method is more self-explanatory.
[/edit]
__________________

Proud member of the T.S.N.B.U.F.L (tables should not be used for layout) alliance.

"Only use elements for their intended purpose. You wouldn't try to make coffee with a telephone, would you?" -Me

Last edited by TheJim01 : July 23rd, 2004 at 01:46 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > onmouseover column bg change


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT