【问题标题】:JQuery tablesorter background image issueJQuery tablesorter背景图像问题
【发布时间】:2013-04-18 19:28:29
【问题描述】:

我已经从 http://tablesorter.com/docs/.

排序部分工作正常,但我无法将背景图像放入表头。

HTML表格代码:

echo '<table id="viewAll" class="tablesorter">';
            echo '<thead>';
            echo '<tr>';
            echo '<th>Product</th>';
            echo '<th>PBI</th>';
                echo '<th>Status</th>';
            echo '<th>Summary</th>';
            echo '<th>Record Created</th>';
            echo '<th>Record Updated</th>';

            echo '</tr>';
            echo '</thead>';

获取背景图片的CSS代码:

table.tablesorter thead tr  .header {
    background-image: url(images/tablesorter/bg.gif);
    background-repeat: no-repeat;
    background-position: left top;
    cursor: pointer;
}

正如我所说的排序工作正常,我可以得到光标指针,但似乎无法打开背景图像。

我错过了什么..?

【问题讨论】:

    标签: jquery tablesorter


    【解决方案1】:

    我感觉 css 选择器很糟糕。根据您要放置背景的内容,&lt;thead&gt; 或每个&lt;th&gt; 这可能会成功http://jsfiddle.net/MVCmx/1/。另外,请检查图像 url 是否确实引用了您应用中的某些内容,图像路径可能是错误的。

    table.tablesorter > thead {
      background-image: url('yourimagepath')
    }​
    

    【讨论】:

      【解决方案2】:

      正确检查您的图像路径,相对路径应如下所示并给出背景 url 而不是背景图像

      background:url("../images/header-bg.gif");
      

      【讨论】:

        【解决方案3】:

        您在 Windows 7 上使用 apache 吗? 我有类似的问题。尝试了很多东西并且 我发现我什至无法直接从 URL 访问图像。 它说“禁止”

        我的问题是主题文件夹中的 bg.gif、as.gif 和 desc.gif 图像 都是加密的。 (你可以通过他们在 Vista 或 7 中的绿色文件名来判断)

        只需通过单击文件->属性->高级来取消加密,然后取消选中加密框。 这应该可以解决问题。

        【讨论】:

        • 您还有其他问题吗?或者它应该成为这篇文章的解决方案吗?
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-03-04
        • 2021-05-14
        • 1970-01-01
        • 2013-03-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多