Open Bug 342264 Opened 19 years ago Updated 2 years ago

JavaScript changing of DOM object link colors

Categories

(Core :: DOM: Core & HTML, defect, P5)

1.8 Branch
x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: damienwatson, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4 The function below (obviously) changes the color scheme of the website. Now in Internet Explorer (god forbid) it works fine everytime. However in Firefox it will not always change the link color. However, in the DOM Inspector the value for the link colors do change every time. I have looked into it, and cannot see any valid reason for it. My function is shown below in case I have stupidly overlooked anything. /* CODE SAMPLE */ var orangeCol = "#E08D21"; var purpleCol = "#5A5BAC"; var blueCol = "#2F6798"; function colorChange( id ) { var objBorder = document.getElementById("content"); if(id == "orange") { objBorder.style.borderColor = orangeCol; document.linkColor = orangeCol; document.alinkColor = orangeCol; document.vlinkColor = orangeCol; } if(id == "blue") { objBorder.style.borderColor = blueCol; document.linkColor = blueCol; document.alinkColor = blueCol; document.vlinkColor = blueCol; } if(id == "purple") { objBorder.style.borderColor = purpleCol; document.linkColor = purpleCol; document.alinkColor = purpleCol; document.vlinkColor = purpleCol; } var objHeader = document.getElementById("heading"); objHeader.style.background = "url('logo_" + id + ".png')"; } /* END CODE SAMPLE */ Reproducible: Always Steps to Reproduce: Just view the page and use the little color changing boxes in the top right corner. Actual Results: Sometimes it will change the link colors along with the border color, but not always. Actually rarely changes the link colors. Expected Results: Should change the link colors all the time. Shouldn't require any additional information. I suppose the fact that I have tested on a number of PC's.
Might be related to bug 243748.
Assignee: nobody → general
Component: General → DOM
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → 1.8 Branch
Summary: Javascript changing of DOM object link colors → JavaScript changing of DOM object link colors
Cannot do a JavaScript "IF check" on 'background-color' property. Doing: if (document.getElementById('element').style.background-color == '#000000') It goes always in the ELSE block..... it never returns True. On all the other browsers instead it works perfectly!
Assignee: general → nobody
QA Contact: ian → general
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.