jQuery运行脚本之后

jQuery运行脚本之后,jquery,plugins,pagination,tablesorter,Jquery,Plugins,Pagination,Tablesorter,我对js操作的加载有问题,我有以下两行代码: $(".sorter td:first-child").css("width", "13px"); $(".sorter td:last-child").css("text-align", "center").css("padding", "0").css("line-height", "0").css("width", "65px"); 这是一个工作。。。但是当我转到tablesorter pager插件的第二页时,它不会再次加载 屏幕截图:

我对js操作的加载有问题,我有以下两行代码:

$(".sorter td:first-child").css("width", "13px");
$(".sorter td:last-child").css("text-align", "center").css("padding", "0").css("line-height", "0").css("width", "65px");
这是一个工作。。。但是当我转到tablesorter pager插件的第二页时,它不会再次加载

屏幕截图:

有人能帮我吗?这就是我所拥有的一切:

var $sorterTable = $(".sorter");
var tablesorterConfig = { widgets: ['zebra'], headers:{ 0:{sorter:false} } };
tablesorterConfig.headers[$sorterTable.find("thead th").length - 1] = { sorter:false };

$sorterTable
.tablesorter(tablesorterConfig)          
.tablesorterPager({container: $("#pager"), positionFixed: false, size : 5 });

$(".sorter td:first-child").css("width", "13px");
$(".sorter td:last-child").css("text-align", "center").css("padding", "0").css("line-height", "0").css("width", "65px");

您还需要在点击寻呼机后设置这些css样式。试试这个

var $sorterTable = $(".sorter");
var tablesorterConfig = { widgets: ['zebra'], headers:{ 0:{sorter:false} } };
tablesorterConfig.headers[$sorterTable.find("thead th").length - 1] = { sorter:false };

$sorterTable
.tablesorter(tablesorterConfig)          
.tablesorterPager({container: $("#pager"), positionFixed: false, size : 5 });

$("#pager").click(function(){
  $(".sorter td:first-child").css("width", "13px");
  $(".sorter td:last-child").css({"text-align": "center","padding": "0", "line-height": "0", "width": "65px"});
});

$(".sorter td:first-child").css("width", "13px");
  $(".sorter td:last-child").css({"text-align": "center","padding": "0", "line-height": "0", "width": "65px"});

您还需要在点击寻呼机后设置这些css样式。试试这个

var $sorterTable = $(".sorter");
var tablesorterConfig = { widgets: ['zebra'], headers:{ 0:{sorter:false} } };
tablesorterConfig.headers[$sorterTable.find("thead th").length - 1] = { sorter:false };

$sorterTable
.tablesorter(tablesorterConfig)          
.tablesorterPager({container: $("#pager"), positionFixed: false, size : 5 });

$("#pager").click(function(){
  $(".sorter td:first-child").css("width", "13px");
  $(".sorter td:last-child").css({"text-align": "center","padding": "0", "line-height": "0", "width": "65px"});
});

$(".sorter td:first-child").css("width", "13px");
  $(".sorter td:last-child").css({"text-align": "center","padding": "0", "line-height": "0", "width": "65px"});

Tablesorter插件的2.0.7版包括
pagerChange
pagerComplete
事件。如果您正在使用此版本(或者如果您可以升级),您可以在
pagerComplete
事件中重新应用样式


Tablesorter插件的2.0.7版包括
pagerChange
pagerComplete
事件。如果您正在使用此版本(或者如果您可以升级),您可以在
pagerComplete
事件中重新应用样式


所有这些脚本所做的都是设置样式。为什么不把它们放在样式表中呢

.sorter td:first-child {
    width: 13px;
}
.sorter td:first-child + td + td + td + td + td {
    text-align: center;
    padding: 0;
    line-height: 0;
    width: 65px;
}

所有这些脚本所做的都是设置样式。为什么不把它们放在样式表中呢

.sorter td:first-child {
    width: 13px;
}
.sorter td:first-child + td + td + td + td + td {
    text-align: center;
    padding: 0;
    line-height: 0;
    width: 65px;
}

$(“.sorter td:last child”).css(“文本对齐”、“居中”).css(“填充”、“0”).css(“行高”、“0”).css(“宽度”、“65px”)
可以稍微缩短为:
$(“.sorter td:last child”).css({“text align”:“center”,“padding”:“0”,“line height”:“0”,“width”:“65px”})
$(“.sorter td:last child”).css(“文本对齐”、“居中”).css(“填充”、“0”).css(“行高”、“0”).css(“宽度”、“65px”)
可以稍微缩短为:
$(“.sorter td:last child”).css({“text align”:“center”,“padding”:“0”,“line height”:“0”,“width”:“65px”})嗨,ShankarSangoli,我已经把它放进去了,但它不起作用-(…这是有效的:
$(“#pager.first,#prev.last,#pager.next,#pager.last,#pager select”)。单击(function(){
只有选择框在选择更多行时不会更新。尝试将其更改为$(#pager img”)。单击(function(){((“.sorter td:first child”)。css(“width”,“13px”)$(.sorter td:last child”)。css({“text align”文本对齐“center”),“padding:“0”,“lineheight:“0”,“width:“65px”});;);嗨,ShankarSangoli,我已经把它放进去了,但它不起作用.(…这起作用:
$(“#pager.first,#prev.last,#pager.next,#pager.last,,#pager select”)。单击(函数(){
,选择更多行时,只有选择框不会更新。尝试将其更改为$(“#pager.img”)。单击(function(){$(“.sorter td:first child”).css(“width”,“13px”);$(“.sorter td:last child”).css({“text align”:“center”,“padding”:“0”,“line height”:“0”,“width”:“65px”});});因为最后一个孩子没有在CSS中使用IE 6、IE 7和IE 8。@Maanstraat-请参阅我回答中的代码示例。您可以使用第一个孩子和相邻的兄弟姐妹选择器在没有最后一个孩子的情况下执行此操作。这些是CSS2选择器,在较旧的浏览器中工作。因为最后一个孩子没有在CSS中使用IE 6、IE 7和IE 8。@Maanstraat-请参阅我的答案中的代码示例。您可以使用第一个子选择器和相邻的同级选择器,而不使用最后一个子选择器。这些是CSS2选择器,适用于较旧的浏览器。