开发者

GWT - loading stylesheet by locale or user action

开发者 https://www.devze.com 2023-03-30 09:40 出处:网络
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 me

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

精彩评论

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