This project is archived and is in readonly mode.

#487 ✓invalid
BasBloemsaat

Element references wrong dom node

Reported by BasBloemsaat | November 20th, 2008 @ 06:42 PM | in 2.0 (closed)

setting opacity on a newly created node works, but reading doesn't (ff3.0.4). IE thowns an error earlier.

Code below reproduces the bug

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

InitTest = function() {
            var newdiv1 = document.createElement('div');
            var newdiv2 = document.createElement('div');
            newdiv1.innerHTML = 'VARIABLE DIV 1';
            newdiv2.innerHTML = 'VARIABLE DIV 2';
            newdiv1.id = 'vardiv1';
            newdiv2.id = 'vardiv2';
            $('content').appendChild(newdiv1);
            $('content').appendChild(newdiv2);
            newdiv1.set('opacity', 0); //start invis
            $("vardiv2").set('opacity', 0);
}

runtest=function() {
    var opvd1 = $('vardiv1').get('opacity'); // 1 ?! should return 0 as well
    var opvd2 = $("vardiv2").get('opacity'); // 0
    alert('1:' + opvd1 + ',2:' + opvd2 );
}

window.addEvent('domready', InitTest);

run test

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Attachments

Pages