绑在body的初始化后js事件上。
setTimeout(function() {
//选择时背景颜色变量
var oldColor = "rgb(255, 255, 255)";
var newColor = "rgb(230, 247, 255)";
$('.x-table td').hover(function() {
if ($(this).attr("style").indexOf("background-color") == -1) {
$(this).css('background', newColor).siblings().css("background", newColor);
}
}, function() {
if ($(this).attr("style").indexOf("background-color") == -1) {
$(this).css('background', oldColor).siblings().css("background", oldColor);
}
});
}, 1000);
改变字体大小,行高
setTimeout(function() {
//选择时背景颜色变量
var oldColor = "rgb(255, 255, 255)";
var newColor = "rgb(230, 247, 255)";
$('.x-table td').hover(function() {
if ($(this).attr("style").indexOf("background-color") == -1) {
$(this).css('background', newColor).siblings().css("background", newColor);
$(this).css("font-size", 16).siblings().css("font-size", 16);
$(this).css("height", 28).siblings().css("height", 28);
}
}, function() {
if ($(this).attr("style").indexOf("background-color") == -1) {
$(this).css('background', oldColor).siblings().css("background", oldColor);
$(this).css("font-size", 12).siblings().css("font-size", 12);
$(this).css("height", 20).siblings().css("height", 20);
}
});
}, 1000);
加粗字体
setTimeout(function() {
//选择时背景颜色变量
var oldColor = "rgb(255, 255, 255)";
var newColor = "rgb(200, 204, 255)";
$('.x-table td').hover(function() {
if ($(this).attr("style").indexOf("background-color") == -1) {
$(this).css('background', newColor).siblings().css("background", newColor);
$(this).css("font-weight", 700).siblings().css("font-weight", 700);
}
}, function() {
if ($(this).attr("style").indexOf("background-color") == -1) {
$(this).css('background', oldColor).siblings().css("background", oldColor);
$(this).css("font-weight", 400).siblings().css("font-weight", 400);
}
});
}, 1000);
改变筛选条件以后如果这个效果失效了,需要在改变条件的控件加编辑结束事件粘贴进效果代码。参数面板的筛选条件不用,改变参数面板会重新渲染body