Changing an element's specific style by associative array is not applied!

RESOLVED INVALID

Status

()

--
major
RESOLVED INVALID
8 years ago
8 years ago

People

(Reporter: donrhummy, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

The following code will not be applied immediately, despite the fact that it can read the property and should be able to set it as well. It requires some other visual thing to occur (within the document window) for it to work!

[code]
var myDiv = document.getElementById( "myDiv" );

//This is NOT immediately applied!
myDiv.style[ "width" ] = "200px";
[/code]


Reproducible: Always

Steps to Reproduce:
1. Try to change the width of a element by using associative array notation

Actual Results:  
Does not change unless another thing occurs (such as popping up an alert box and then repositioning the element).

Expected Results:  
immediate change of the style.
Works fine for me.  Can you post a complete testcase (using the "Add an attachment" link) showing the problem?
(Reporter)

Comment 2

8 years ago
I apologize, you can remove this. The issue was actually with the "src" of an image was taking a while to load (longer than it took to get to the next statement which used the width), so that's why it was not being set immediately.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.