管理员登陆

停止 继续 暂停 收听本文

给 title 提示文字加上CSS样式

<script>

var oldTitle = null;
$(document).bind('mouseover mouseout mousemove',function(event){           
    var left = event.pageX , top = event.pageY;
    var ele = event.target;
    var title = ele.title;

    var type = event.originalEvent.type;
    if(type == 'mouseover'){
        oldTitle = title;
        ele.title = '';
        //if(title && title.length > 0){                
        if(title != null){              
            var showEle = $('<div></div>',{text:title,class:'showTitleBox'}).css({
                position:'absolute',
                top:top+10,
                left:left,
                border:'1px solid #CCC',
                borderRadius:'5px',
                background:"infobackground",
                fontFamily:'SimHei',
		fontSize: '50px'
            })
            showEle.appendTo('body');               
        }
    }else if(type == 'mouseout'){
        ele.title = oldTitle;
        $('.showTitleBox').remove();
    }else if(type == 'mousemove'){
        $('.showTitleBox').css({
            top:top+10,
            left:left
        })
    }
})

</script>

信息科技 2020-04-10 08:14:30 通过 网页 浏览(3073) 打印

上一篇

上一篇文章

共有0条评论!

发表评论