开发者

GWT - loading stylesheet by locale or user action

Is there a way to load an external stylesheet by setting locale or other user action? I would like to change the style presentation based on a u开发者_如何学Goser input.


You have to use JSNI and DOM methods to create (and add to DOM) a new <link> tag:

private native void loadCSS (String cssHref) /*-{
    document.write('<link rel="stylesheet" type="text/css" href="' +
        cssHref + '">');
}-*/;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜