<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * 鼠标划过时自动修改颜色
 *
 * @author yzxh24
 */
class TableCover extends CWidget
{
    public function run()
    {
        $clientScript = Yii::app()->getClientScript();
        $script = <<<EOT
$('document').ready(function(){
	$(".post tr").live('mouseover', function(){
		$(this).addClass("over");});
	$(".post tr").live('mouseout', function(){
		$(this).removeClass("over")});
});
EOT;
        $clientScript->registerScript('TableCover', $script);

        $css = <<<EOT
tr.over td {
	background:#bcd4ec;  /*这个将是鼠标高亮行的背景色*/
}
EOT;
        $clientScript->registerCss('table', $css);
    }
}
