http://franca.exofire.net/jq/colorize

Coloriza 是一个Jquery 插件,可以为表格的行添加背景颜色,鼠标动作后为行、列增加高亮效果。你可以为很多行、列填色,只要你愿意。再从点击已经填色的行、列就可以还原表格本色。

怎么使用?

使用默认设置(colorizes a row)
$(‘#yourTableId’).colorize() ;

其他设置和参数:

altColor : alternate row background color. The default is ‘#ECF6FC’, ‘none’ can be used for no alternate background color.交替行的背景颜色。默认值为’#ECF6FC’,’none’ 可替代的背景颜色使用。
bgColor : background color (The default background color is white).背景颜色(默认背景颜色为白色)。
hoverColor : background color when you hover a mouse over a row. The default is ‘#BCD4EC’.背景颜色当鼠标经过行。默认值为’#BCD4EC’。
hoverClass: style class for mouseover; takes precedence over hoverColor property为鼠标经过样式类;hoverColor优先
hiliteColor : row highlight color. The default color is ‘yellow’. ‘none’ can be used to disable highlighting.行高亮颜色。默认的颜色是’黄色’。 ‘none’可以用来取消高亮。
hiliteClass : style class to be used to highlight a row or a column, takes precedence over the hiliteColor setting.样式类可用于强调一行或一列,hiliteColor设置优先。
columns : true/false/’hover’/'rowHover’ – 默认 ‘false’. 如果 ‘true’,列高亮. 如果是 ‘hover’, a column is highlighted on mouseover鼠标经过时列高亮, but does not respond to clicking但是点击没有效果. 相反, a row is highlighted when clicked一行被点击时候高亮. 如果是 ‘rowHover’, a row is highlighted on mouseover鼠标经过时行高亮, and a column is highlighted on click点击后列高亮.
oneClick : true/false – Allows only one row or column to be highlighted at a time. A click on a new row/column cancels the current highlight. The default is false.true/false-只允许一行或一列加以高亮每次。点击新行/列取消当前的高亮效果。默认值为false。

banColumns :[]- Prevents certain columns from being highlighted when clicked, and also on mouseover. Supply an array of column indices as an argument. A value of ‘last’ can be used to ban the last column.可以实现被点击或鼠标经过时某些列不高亮 ,提供一个数组作为参数列指数。值为’last’可以用来禁止的最后一列。

banDataClick :true/false – If true, you can only click on table header rows. The default is false.如果‘true’,你只能点击表格标题行。默认值为false。
ignoreHeaders :true/false – If true, header rows are not colorized. (no striping). The default is true.如果‘true’,头行不彩色。 (不分段)。默认值为true。

nested :true/false . The default is false. Use it for more consistent striping if a table contains nested tables.默认值为false。使用更一致的条带,如果一个表包含嵌套表。

示例:

The order of parameters is not important.
$(‘#yourTableId’).colorize({bgColor:’#EAF6CC’, hoverColor:’green’, hiliteColor:’red’});
$(‘#yourTableId’).colorize({ oneClick:true});
$(‘#yourTableId’).colorize({columns:true, banColumns :[0,1]});
$(‘#yourTableId’).colorize({ hiliteClass:’myStyle’});

没有高亮:
$(‘#yourTableId’).colorize( { hiliteColor:’none’ } );

提示:你可以先修改部分代码再运行。

anyShare分享到:
          

相关文章

  1. JQuery 新闻头条淡入淡出效果
  2. JQUERY 层-隐藏-显示 效果
  3. dedecms列表中显示文章的完整标题
  4. Jquery 获取元素数量 length
  5. DeDeCMS 在列表调用'tag'标签