我正在使用 Grails 1.3.7,我想同时使用资源插件和 jquery ui,当我想切换到不同的 jquery ui 主题时,问题就来了。我不能给出主题论点。

我使用这个标签:

<r:use module="jquery" /> 
<r:use module="jquery-ui" theme="smoothness" /> 

但不起作用,也尝试了 themeCSS 属性但没有效果。

谢谢。

请您参考如下方法:

您可以在自己的本地资源定义中覆盖默认的 jquery-theme 资源(如/conf/AppResources.groovy)。为此,请添加覆盖部分,例如:

modules = { 
... 
    overrides { 
        // this overrides the default ui-lightness theme from jquery-ui plugin 
        'jquery-theme' { 
            resource id:'theme', url:'/css/themes/my-theme/jquery-ui.custom.css', attrs: [media: 'screen, projection'] 
        } 
    } 
... 
} 

相应地调整 url 以指向从 ThemeRoller 下载的主题 css。然后只需使用
<r:require module="jquery-ui" /> 

jquery-ui 模块依赖于 jquery-theme 并将根据您的覆盖定义拉取它。


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!