鼠标移动,显示具体内容

.div {margin:0 auto;width:1000px;text-align:right;}
        .markbox {
            border-radius: 5px;
            padding: 5px;
            background: #ffcc66;
            position: absolute;
        }
$('#ms a').mouseover(function (e) {
        var x = e.pageX + 10 + 'px', y = e.pageY + 10 + 'px';
        var value = $(this).attr('title');
        $(this).attr('title', '');
        $div = '<span class="markbox" style="left:' + x + ';' + "top:" + y + '">' + value + '</span>';
        $('.markbox').css({'left': x, 'top': y});
        $(this).parent().append($div);
        return false
    }).mouseout(function () {
        $(this).attr('title', $('.markbox').html())
        $('.markbox').remove();
        return false
    }).mousemove(function (e) {
        var x = e.pageX + 10 + 'px', y = e.pageY + 10 + 'px';
        $('.markbox').css({'left': x, 'top': y});
        return false
    })
<td align="center" id="ms"><a href="javascript:void(0)" title="<?php echo $v['content']; ?>">详情</a></td>

 

posted @ 2018-04-20 15:55  微客鸟窝  阅读(150)  评论(0编辑  收藏  举报
/* 看板娘 */