Prototype 1.6.0.rc0 - setStyle defect

144 views
Skip to first unread message

Heiko Rabe

unread,
Aug 19, 2007, 5:47:29 PM8/19/07
to Prototype: Core
Following the example, that works perfectly in 1.5.1.1 but not at
1.6.0.rc0:

this.img.setStyle(
{
'display' : 'block',
'left' : vp.cx - this.image.img.width/2 + 'px',
'top' : Math.max((vp.cy - vp.dim/2), 5) + 'px',
'background-color' : '#202020',
'z-index' : vp.zi
}
);

where img is an image object prior stored at a holder instance and
should now get a
new style based positioning and coloring.
The image and also the container arround are set into
"position:absolute" by style sheet.

issue:

Both params "background-color" and "z-index" won't be set anymore
using 1.6.0.rc0.
The exact same code does it well by using 1.5.1.1.

Did you have any suggestion, what can be done inside changed setStyle
method ?

regards

Gareth Evans

unread,
Aug 19, 2007, 7:24:07 PM8/19/07
to prototy...@googlegroups.com
Hi Heiko
I think you've run into one of the backwards compatibility changes
 
From Changelog:
 
$("header").setStyle("font-size: 12px; float: left; opacity: 0.5");
 

Note that for performance reasons, we've deprecated the use of uncamelized style property names when setting styles using a hash. So If you have code that looks like this:

$
("header").setStyle({ "font-size": "12px"
 }); 
You need to replace it with either of the following:
$("header"
).setStyle({ fontSize: "12px" }); 
$("header" ).setStyle("font-size: 12px");

On 8/20/07, Heiko Rabe <in...@code-styling.de> wrote:

Following the example, that works perfectly in 1.5.1.1 but not at
1.6.0.rc0 :

       this.img.setStyle(
               {
                       'display'       : 'block',
                       'left'          : vp.cx - this.image.img.width /2 + 'px',
Reply all
Reply to author
Forward
0 new messages