Hi,
I use a DockLayoutPanel as the root panel for my application. It uses the followijg CSS style:
.display
{
margin:0px;
/*# center center; */
background-color: #000000;
background-image: url(img/Background/std.jpg);
background-repeat: no-repeat;
background-position: 0px 60px;
}
Now the users should be able to disable the background image. So I deleted the line for "background-image" above and add it dynamically, if the user wants it:
if (userWantsBackground)
{
Style s = getElement().getStyle();
s.setBackgroundImage("img/Background/std.jpg");
}
However, this statement has no effect. No background is shown. When using "inspect element" in chrome, there is no property "background-image".
But I am sure that this code is called (verified with Window.alert).
Questions:
- How can I add the property "background-image" to an existing style?
- What about the image itself? Will it be loaded automatically, when I set the style?
Thanks a lot!
Magnus