开发者

Dynamically Modify CSS from GWT

for example I have a css in test.css given below.

.test {

开发者_运维百科  top:100px;

 }

how can i increment top property from GWT ?


e.g. you can retrieve the Style of the element and alter that. other type of widgets might have other functionalities


You can hold value in memory and just set it at any time you need it via runtime substitution which is built-in GWT feature.

@eval userBackground com.module.UserPreferences.getUserBackground();
div {
   background: userBackground;
}

public class UserPreferences {
    public static String getUserBackground() {
        return "#FF0000";
    }
}

Please check GWT specs: http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#Runtime_substitution

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜