Prototype.js and setStyle()

Internet Explorer 7 made a lot of trouble with the setStyle()-method provided by Prototype.js. in a forum handgestrickt found the hint not to use it as a DOM-element-method, but as a method of the Element-object. that worked for us.

this does not work (sometimes):

$('some_id').setStyle({
        top: '10px',
        left: '10px',
        //..... more styles
});

this works fine (always):

Element.setStyle($('some_id'),{
        top: '10px',
        left: '10px',
        //..... more styles
});

related:
Google groups post

Wednesday, 18. April 2007 • trackback url

Add Comment

( to reply to a comment, click the reply link next to the comment )

Comment Title:
Your Name:
Email Address:
Make Public?
Website:
Make Public?

Comment:


Allowed XHTML tags : a, b, i, strong, code, acrynom, blockquote, abbr. Linebreaks will be converted automatically.


Captcha:

captcha image

please type the content of the above image into the following form-field: