|
| Index | Recent Threads | Unanswered Threads | Who's Online | User List | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 12
|
|
| Author |
|
|
Advanced Member Ohio, USA Joined: May 30, 2004 Post Count: 2677 Status: Offline |
IE 7 will support the hover pseudo class on other elements aside from the anchor tag. So adding td:hover {background: #??????} to the CSS will work on all browsers except IE 6 and previous. Problem is too many people use IE for that alone to be a viable option. Adding the following will make it work without js on a decent browser and with js on IE 6 and less CSS td, .jsout {background: #???;} td:hover, .jshover {background: #???;} Javascript function changeBG(){ var bg = document.getElementsByTagName("td"); for (i = 0, j = bg.length; i < j; i++) { bg.onmouseover=function() { this.className="jshover"; } bg.onmouseout=function() { this.className="jsout"; } } } window.onload=function(){ changeBG(); } The above quote is from Billyboy's post in this thread. I didn't want to hijack that one with my troubleshooting, so I'm starting a new one. I'm sure I've done something wrong, but the hover is not working in IE for me on this page. Oh, and ignore the hideous looking divs above the table. I'm not sure what I'm doing with that info yet. YUCK, though! LOL |
||
|
|
Advanced Member Ohio, USA Joined: May 30, 2004 Post Count: 2677 Status: Offline |
td, .jsout {background: #???;} td:hover, .jshover {background: #???;} I have another question about this. I want the hover effects to only apply to these particular pages and not to my other tables. To do so, I would create a class, correct? How would that look exactly? I understand that for the td I would say td.classname but I don't know how to do it with the .jsout and td:hover, and .jshover . |
||
|
|
Advanced Member Joined: Sep 3, 2005 Post Count: 2206 Status: Offline |
I'm sorry Susie, you aren't the one that's done something wrong, it was me. I know I checked that code to see if it worked but I must have mucked with it before posting. I can't get it to work now either. Anyway I did find the original again and I swear it works this time. To target just the one table I added in getElementById. Change myTable what suits you and give your table a matching id. I also changed td to tr since you want to affect the whole row and not just one cell. function changeBG(){---------------------------------------- Quiquid latine dictum sit altum viditur ---------------------------------------- [Edit 4 times, last edit by billyboy at Jun 20, 2006 5:57:12 AM] |
||
|
|
Advanced Member Ohio, USA Joined: May 30, 2004 Post Count: 2677 Status: Offline |
Thanks, Bill. I'm still having trouble with it, so I'm going to study this code some more and see if I can figure out my mistake. ![]() |
||
|
|
Advanced Member Joined: Sep 3, 2005 Post Count: 2206 Status: Offline |
The javascript looks okay but in your CSS you have an extra period after the tr: tr. , .jsout {background: #feffee;} Take that out and see if it works. ---------------------------------------- Quiquid latine dictum sit altum viditur |
||
|
|
Advanced Member Ohio, USA Joined: May 30, 2004 Post Count: 2677 Status: Offline |
It still isn't working. I think it doesn't like me. hehe |
||
|
|
Advanced Member Joined: Sep 3, 2005 Post Count: 2206 Status: Offline |
The period after the tr is still there. ---------------------------------------- Quiquid latine dictum sit altum viditur |
||
|
|
Advanced Member Ohio, USA Joined: May 30, 2004 Post Count: 2677 Status: Offline |
It is? I thought I got it. Here's what I have: tr, .jsout {background: #feffee;} Should the period before jsout be gone too? |
||
|
|
Advanced Member Joined: Sep 3, 2005 Post Count: 2206 Status: Offline |
Hmm guess I was viewing an old version of the page, cleared my cache and its gone. Nope leave the period for .jsout, thats a class. I missed something the first time I looked at the javascript, this <style type="text/javascript"> should be <script type="text/javascript"> ---------------------------------------- Quiquid latine dictum sit altum viditur ---------------------------------------- [Edit 1 times, last edit by billyboy at Jun 20, 2006 8:00:36 AM] |
||
|
|
Advanced Member Ohio, USA Joined: May 30, 2004 Post Count: 2677 Status: Offline |
And there's my mistake. Oh my gosh, I feel so foolish. Thanks for taking your time to help me figure this out, Bill. I owe you. (I owe a lot of people here...how will I ever repay? LOL)![]() |
||
|
|
|
|
|
Current timezone is GMT May 22, 2013 6:19:48 PM |