【问题标题】:jquery themes not workingjquery 主题不起作用
【发布时间】:2011-03-10 18:08:36
【问题描述】:

知道为什么 jquery ui 主题在 jsfiddle 中不起作用,但它在我的本地主机上起作用吗?

http://jsfiddle.net/oshirowanen/UxvaG/

【问题讨论】:

  • 代码中显示错误
  • 你需要包含所有必要的 CSS

标签: jquery jquery-ui jquery-ui-sortable jquery-ui-theme


【解决方案1】:

JS 需要一个 portlet 类,而 HTML 使用小部件类。

【讨论】:

    【解决方案2】:

    从左侧的下拉列表中删除 $(document).load 包装器或更改为 nowraphttp://jsfiddle.net/UxvaG/1/

            $( ".column" ).sortable({
                connectWith: ".column"
            });
    
            $( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
                .find( ".portlet-header" )
                    .addClass( "ui-widget-header ui-corner-all" )
                    .prepend( "<span class='ui-icon ui-icon-minusthick'></span>")
                    .end()
                .find( ".portlet-content" );
    
            $( ".portlet-header .ui-icon" ).click(function() {
                $( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" );
                $( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
            });
    
            $( ".column" ).disableSelection();
    

    如果在左侧选择lib的地方选择onLoad,那么jsfiddle会自动将代码包裹在$(document).load({})

    【讨论】:

      【解决方案3】:

      你必须缺少一些 CSS,使用 ThemeROller

      下载 ThemeRoller 主题:The 构建主题的最简单方法是使用 ThemeRoller 生成和 下载一个主题。这个应用程序将创建 一个新的 ui.theme.css 文件和图像 包含所有必要的目录 背景图像和图标精灵 可以简单地将其放入您的 项目。这种方法将是 最容易创建和维护,但 将自定义限制为选项 在 ThemeRoller 中提供

      reference

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-12-04
        • 2015-01-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多