【问题标题】:DataTable pagination page selected colorDataTable分页页面选择颜色
【发布时间】:2019-12-15 22:34:12
【问题描述】:

我正在使用 Ajax 数据表,当我选择一个页面时,我想要一个 css,而任何页面选择的背景颜色都应该更改,而不仅仅是鼠标悬停或活动。我怎么能做到这一点。这是我的 css 代码,它不是我想要的。

 .dataTables_paginate :active {
        background-color: blue;
    }

请注意,它仅适用于页面点击。我想要我现在应该是不同颜色的页面。提前致谢 这是我的数据表代码。

function LoadPaging() {
    $('#tblChannalList').DataTable({
        "searching": false,
        "lengthChange": false,
        "bInfo": false,
        "iDisplayLength": 5,
        "showNEntries": false,
        "dom": '<"top"i>rt<"bottom"flp><"clear">'
        //"dom": '<"top"f>rt<"bottom"lp><"clear">',
        //"sDom": 'RlfrtlipB',
        //"dom": '<"top"iflp<"clear">>rt<"bottom"iflp<"clear">>'
    });

    return;
}

这是我的css代码

.paginatebutton {
    background-color: white;
}



.dataTables_paginate {
    width: 270px;
    height: 30px;
    position: fixed;
    background-color: white;
    top: 50%;
    left: 50%;
    margin-top: 340px;
    margin-left: -100px;
    /*text-align: center;*/
    /*float: left !important;*/
}
    .dataTables_paginate:active {
        background-color: blue;
        color:red;
    }
    .dataTables_paginate .paginate_button.current {
        background: blue !IMPORTANT;
    }
/*.pagination .page-item.current .page-link {
    background-color: #000;
}*/
.pagination .page-item.active .page-link {
    background-color: #000;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item.active .page-link:focus {
    background-color: #000;
}

.pagination .page-item.active .page-link:hover {
    background-color: #000;
}

【问题讨论】:

标签: jquery html css jquery-ui datatables


【解决方案1】:

用下面的更新你的CSS。 :active 之间有多余的空间。

.dataTables_paginate:active {
        background-color: blue;
    }

如果这不起作用,那么这将起作用。

.dataTables_paginate .paginate_button.current {
    background: blue !IMPORTANT;
}

【讨论】:

  • 没用。我需要js代码来更改当前选择的页面@Sumit Patel
  • 没有数据表将当前类添加到活动页面,所以第二个解决方案应该可以工作,我在那里测试。你能添加你的代码我可以检查。
  • 试试这个 .pagination .page-item.active {background-color: blue !important;}
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-02-16
  • 1970-01-01
  • 2013-09-24
  • 2013-04-10
  • 2013-08-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多