DOM bug or feature?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

DOM bug or feature?

Colin Kincaid Williams
Hi,

I'm setting my page background via javascript by DOM reference
document.body.style.background="#f3f3f3 url('/images/xenopus.jpg')
no-repeat center fixed";

It sets the background image properties as expected . I'm also trying to
change the background image size

body {
    background-size: 20% auto;
}

however, the background image size does not seem affected. However it does
seem to work in webkit browsers. I tested chrome, and somebody else told me
it works in safari.

Document.body.style.background doesn't have option for background size, why
is the background-size not applying? Is this a bug or does it have to do
with firefoxen dom traversal? The page in question is
http://freediscord.com/usingBodyBkgrnd.html .

Furthermore, I noticed in firebug it shows the CSS set as:

element.style { background: url("/images/xenopus.jpg") no-repeat fixed
center center #F3F3F3; }
body { background-size: 20% auto;}

So shouldn't my background-size be set? Is this a bug or is this how its
supposed to work. I'd really like to get it working in both webkit and
gecko....
Sorry if this is the wrong place for my question.

Best,

Colin Williams
_______________________________________________
dev-tech-dom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-dom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DOM bug or feature?

Boris Zbarsky
On 12/1/11 5:37 PM, Colin Kincaid Williams wrote:
> Document.body.style.background doesn't have option for background size, why
> is the background-size not applying? Is this a bug or does it have to do
> with firefoxen dom traversal? The page in question is
> http://freediscord.com/usingBodyBkgrnd.html .

This seems to work fine for me in both Firefox 8 and a current Aurora
build.  What Firefox version did you test?

> element.style { background: url("/images/xenopus.jpg") no-repeat fixed
> center center #F3F3F3; }
> body { background-size: 20% auto;}
>
> So shouldn't my background-size be set?

Set where?

-Boris
_______________________________________________
dev-tech-dom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-dom
Loading...