HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

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 December 27th, 2003, 11:31 AM
Antixat Antixat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 219 Antixat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 59 m 48 sec
Reputation Power: 5
Send a message via MSN to Antixat
OnMouseOver bgColor change with id

ok here's what im looking for.. I want the background of multiple tables to change when a mouseover is activated..

right now I have this:

<td id="ql1" onmouseover="ql1.bgColor='#FFFFFF'">

but it doesnt seem to work.. does anyone know what I should change?

thanks in advance

Reply With Quote
  #2  
Old December 27th, 2003, 11:53 AM
nolachrymose nolachrymose is offline
The Forest
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 321 nolachrymose User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Code:
<td id="ql1" onmouseover="this.style.backgroundColor = '#fff';">


Hope that helps!

Happy coding!

Reply With Quote
  #3  
Old December 27th, 2003, 11:55 AM
Antixat Antixat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 219 Antixat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 59 m 48 sec
Reputation Power: 5
Send a message via MSN to Antixat
no.. as I said I want it to change the color for multiple tables when onmouseover is active.. so when onmouseover is activated it changes the bg color on all tables that have id="ql1"

Reply With Quote
  #4  
Old December 27th, 2003, 12:41 PM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,590 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 12 h 38 m 48 sec
Reputation Power: 511
but only one element can have the id ql1,
id must be unique, within a document
http://www.w3.org/TR/1998/REC-html4...al.html#h-7.5.2

Reply With Quote
  #5  
Old December 27th, 2003, 12:49 PM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
<table id="ql0" class="standard" onMouseover="goChange(1,'ql')">...</table>
<table id="ql1" class="standard" onMouseover="goChange(1,'ql')">...</table>


function goChange(numOf,id) {
for(i = 0; i <= numOf; i++) {
temp = eval("document.getElementById('"+id+numOf+"')");
temp.className = 'highlight';
}
}

And setup two css classes called standard & highlight.

It's not a perfect solution, but should give you groundwork to expand on.

-D

Reply With Quote
  #6  
Old December 27th, 2003, 01:22 PM
Antixat Antixat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 219 Antixat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 59 m 48 sec
Reputation Power: 5
Send a message via MSN to Antixat
hmm.. so now I have this:

Code:
<html>
<head>
<style type="text/css">
.highlight
{
color:#FFFFFF;
}
.normal
{
}
</style>
<script language="JavaScript">
<!--
function goChange(numOf,id) {
for(i = 0; i <= numOf; i++) {
temp = eval("document.getElementById('"+id+numOf+"')");
temp.className = 'highlight';
}
}
//-->
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td id="ql0" class="standard" onMouseover="goChange(2,'ql')" onmouseout="this.bgColor=''">td 1</td>
    <td id="ql1" class="standard" onMouseover="goChange(2,'ql')" onmouseout="this.bgColor=''">td 2</td>
    <td id="ql2" class="standard" onMouseover="goChange(2,'ql')" onmouseout="this.bgColor=''">td 3</td>
  </tr>
</table>
</body>
</html>


but then nothing happens..
what am I doing wrong?

edit:

sorry should have used "background-color", but now it still only changes the bg color for the last table.. (ql2)

Last edited by Sc0rp : December 27th, 2003 at 01:28 PM.

Reply With Quote
  #7  
Old December 27th, 2003, 01:32 PM
Antixat Antixat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 219 Antixat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 59 m 48 sec
Reputation Power: 5
Send a message via MSN to Antixat
nvm that either..

temp = eval("document.getElementById('"+id+numOf+"')");

should have been

temp = eval("document.getElementById('"+id+i+"')");

thanks mate..

Reply With Quote
  #8  
Old December 29th, 2003, 08:04 AM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
Glad it worked.

-D

Reply With Quote
  #9  
Old April 26th, 2008, 09:11 AM
o2madness o2madness is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 1 o2madness User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 28 sec
Reputation Power: 0
Quote:
Originally Posted by nolachrymose
Code:
<td id="ql1" onmouseover="this.style.backgroundColor = '#fff';">


Hope that helps!

Happy coding!


You Rule! it works great!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > OnMouseOver bgColor change with id


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway