鼠标悬停显示注解

<td><img title=""  class="light" src="${res}/img/yellow.png"></img></td>

<script>

    $(".light").mouseenter(function(){
        var at = $(this).attr("src");
        if(at.indexOf("yellow") > -1) {
            $(this).attr("title","警告!");
        }else if (at.indexOf("green") > -1) {
            $(this).attr("title","正常!");
        }else if (at.indexOf("red") > -1) {
            $(this).attr("title","逾期!");
        }
    });
    
</script>

 

posted on 2016-12-20 19:07  ckx0709  阅读(168)  评论(0编辑  收藏  举报

导航