home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

mouseover divs

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1633
Discussions: 200,933, Posts: 2,379,187, Members: 246,298
Old January 23rd, 2006, 05:54 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Jun 2004
Location: south jersey, USA
Posts: 103
Send a message via ICQ to csamuels Send a message via AIM to csamuels Send a message via Yahoo to csamuels
mouseover divs

i have a page that can create different reports based on user input. I want to show the user which report they are trying to create by changing the bgcolor of its div. When the page loads, it should change the bgcolor of the default report div...so the user knows that report is selected. The user can mouseover other report divs which will highlight their div and if the user clicks the link in the div, the page changes and the report that was clicked stays highlighted.

i wrote the following code, but its not working properly. The default report is not highlighted. The mouseover highlight works, but the mouseout "unhighlight" does not. Also, im having a hard time figuring out which report is selected

Code:
<script>
function highlight(a) {
  //alert(a.style.backgroundColor);
  if (a.style.backgroundColor="#CCCCCC")
    a.style.backgroundColor="#FFFFCC";
  else
    a.style.backgroundColor="#CCCCCC";
}
function shaderpt(a) {
  switch (window.location) {
    case /faxes_sent/:
      document.getElementById("faxes_sent").style.backgroundColor="#FFFFCC";
      break;
    case /md_nb_count/:
      document.getElementById("md_nb_count").style.backgroundColor="#FFFFCC";
      break;
  }  
}</script>

...

<tr>
  <td rowspan=5><div id=faxes_sent onmouseover=highlight(document.getElementById("faxes_sent")) 
                onmouseout=highlight(document.getElementById("faxes_sent")) style=shaderpt(document.getElementById("faxes_sent"))>
                <a href="<%= request.servervariables("URL") %>?description=faxes_sent">Faxes Sent</a></div><br>
                
                <div id=md_nb_count onmouseover=highlight(document.getElementById("md_nb_count")) 
                onmouseout=highlight(document.getElementById("md_nb_count")) style=shaderpt(document.getElementById("md_nb_count"))>
                <a href="<%= request.servervariables("URL") %>?description=md_nb_count">MD NB Count</a></div><br>
  </td>
</tr>
here's a pic
csamuels is offline   Reply With Quote
Old January 23rd, 2006, 06:03 PM     #2 (permalink)
Ultimate Member
 
TOAD6147's Avatar
 
Join Date: Oct 2001
Posts: 5,424
Send a message via ICQ to TOAD6147
What's a 'div'?
__________________
"Education: That which discloses to the wise and disguises from the
foolish their lack of understanding."
Ambrose Bierce
TOAD6147 is offline   Reply With Quote
Old January 23rd, 2006, 06:09 PM     #3 (permalink)
Member
 
Join Date: Jun 2004
Location: south jersey, USA
Posts: 103
Send a message via ICQ to csamuels Send a message via AIM to csamuels Send a message via Yahoo to csamuels
The <div> tag is used to designate a block-line portion of an HTML document as a div element and to apply any of the core attributes of this tag against the contents of that element. The behavior of this tag is block-line, because this tag causes a line break (the equivalent of a br tag) to occur both before and after the div element. div tags, which can be nested, allow a significant degree of control and manipulation of each individual block section of your web page.
csamuels is offline   Reply With Quote
Old January 23rd, 2006, 07:22 PM     #4 (permalink)
Ultimate Member
 
TOAD6147's Avatar
 
Join Date: Oct 2001
Posts: 5,424
Send a message via ICQ to TOAD6147
Wow! I'm almost sorry I asked. Hopefully someone who does know what you're talking about will be along to help you out.
TOAD6147 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
drop down selection show/hide divs csamuels Webmastering and Programming 1 January 18th, 2006 05:55 PM
Mouseover HTML not working correctly SpaceSquad Webmastering and Programming 4 September 20th, 2005 04:33 PM
mouseover ClubMed Webmastering and Programming 4 May 17th, 2004 05:07 AM
Threads grey on mouseover? jkrohn IMO Community 12 May 7th, 2002 12:20 PM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2882)
California Passes Anti-Flat-HDTV Le.. (39)
Obama the Muslim (14)
Is the PSU I received dead? (10)
windows vista security holes (9)
Install XP pro and a Vista laptop ?.. (11)
HIS HD5770 graphic card question (15)
Print spooler problem (13)
Foreign voltage (10)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
EVGA 9800 gtx help with finding a g.. (8)
New Computer wont recognize XP disc (7)
Ideal cheap graph card for PC-Gamin.. (17)
Recent Discussions
Wireless Televisions. (3)
CPU fan stops spinning randomly (2)
World's largest Monopoly Game using G.. (332)
Ideal cheap graph card for PC-Gaming? (17)
BIOS won't read disk when I try to fl.. (0)
Install XP pro and a Vista laptop ?? (11)
Partition Magic caused HDD problem (2)
Graphics Card Upgrade Question (1)
favorit (1)
solutions for virtical white lines on.. (1)
Regular Build (3)
Fire in DVD (2)
Modern Warfare For the PC (33)
radeon x850xt platinum & shader 3 (3)
Have you switched yet? (84)
Wireless Router+Cable Modems and Much.. (0)
Optical Audio A-B Switch (1)
windows vista security holes (9)
The NTDVM CPU has encountered an ille.. (24)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (34)
Wireless speakers for PC? (11)
Print spooler problem (13)
Help getting around port 80 for camer.. (2)
Display shows 3x5 inch in middle of s.. (3)
monitor will not turn on at all, (1)


All times are GMT -4. The time now is 09:42 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28