[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 05-23-2006, 02:29 AM   #1 (permalink)
NamePros Member
 
monty's Avatar
 
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
104.00 NP$ (Donate)

monty is an unknown quantity at this point


again, more IE headaches...

Damn, I hate this shitty software more everyday, pardon my French.

My issue is the next JavaScript function:

function menuHomeSwitch() {

//set all items to #B5C4DD for background color
var temp = document.getElementsByName('nav')

for (var x = 0; x<temp.length; x++) {

temp[x].style.background = '#B5C4DD'
}
}

I have an serie of <td> tags with the name 'nav', and like the function shows, all I need to do is set the background colors to a different color. According to the DOM level 1 specification, this should work and it does so in all browsers, ACCEPT IE ofcourse.

Any suggestions before I kill myself?

tnx much!

-monty
monty is offline  
Old 05-23-2006, 06:54 AM   #2 (permalink)
JFS
NamePros Regular
 
JFS's Avatar
 
Join Date: Oct 2005
Location: Portugal
Posts: 760
56.85 NP$ (Donate)

JFS is just really niceJFS is just really niceJFS is just really niceJFS is just really niceJFS is just really niceJFS is just really nice


why don't you use CSS instead ?
__________________
Joćo Fernandes Silva
Selling :
19P.ORG - ARCADEHITS.ORG - AZIAN.NET - COREFANS.COM - CTUTORIALS.NET - DEDISEEK.COM - HITCHECK.COM - HOST15.COM - HOSTCUSTOMER.COM - LARGETIPS.COM - SCRIPTCANDY.COM - VISUALBOOK.NET - VOXVPS.COM / .NET - WALLPAPERSARENA.COM
JFS is offline  
Old 05-23-2006, 10:39 AM   #3 (permalink)
NamePros Regular
 
Noobie's Avatar
 
Join Date: Feb 2006
Location: Montreal, Quebec, Canada
Posts: 324
66.75 NP$ (Donate)

Noobie is on a distinguished road


style.background-color='#whatever';
__________________
Goldkey.com is a scam
What's your BMI? | Timestamp Generator
Noobie is offline  
Old 05-23-2006, 01:32 PM   #4 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
 
Join Date: Feb 2006
Posts: 2,801
56.00 NP$ (Donate)

Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future

Autism Autism Autism Autism Autism Autism Autism
document.getElementsByName('nav').style.background = '#B5C4DD';

It'd be easier to use a class and some CSS.
Dan is offline  
Old 05-23-2006, 07:36 PM   #5 (permalink)
NamePros Member
 
monty's Avatar
 
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
104.00 NP$ (Donate)

monty is an unknown quantity at this point


Thanks for helping out everybody!

Quote:
Originally Posted by Dan Friedman
document.getElementsByName('nav').style.background = '#B5C4DD';

It'd be easier to use a class and some CSS.
So, I tried this, I changed the function to:

function menuHomeSwitch() {

//set all items to #B5C4DD for background color
document.getElementsByName('nav').style.background = '#B5C4DD'
}

And set the <td> tags class attribute to "nav", but still no joy, this doesn't in other browsers as well. Now, I didn't get much sleep last, so am I missing something here?

-monty
monty is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 05:13 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85