帆软报表(finereport)使用Event 事件对象 (target)修改提示框样式

target 事件属性

定义和用法

target 事件属性可返回事件的目标节点(触发该事件的节点),如生成事件的元素、文档或窗口。

语法

event.target

定义结束事件JavaScript

JS修改内容提示框样式-https://help.finereport.com/doc-view-2518.html

var oldTitle = null;
$('td').bind('mouseover mouseout mousemove', function(event) {
var left = event.pageX;
var top = event.pageY;
var ele = event.target;
var title = ele.title;
var type = event.originalEvent.type;
if (type == 'mouseover') {
oldTitle = title;
ele.title = '';
console.log(title);
if (title.length != 0) {
var showEle = $('<div></div>', {
text: title,
class: 'showTitleBox'
}).css({
position: 'absolute',
top: top + 10,
left: left,
border: '1px solid #00cccc', // 边框
borderRadius: '5px',    // 边框圆角
background: "#00cccc",       // 背景色
fontFamily: 'SimHei',        // 字体
fontSize: '15px'             // 字体大小
})
showEle.appendTo('body');
}
} else if (type == 'mouseout') {
ele.title = oldTitle;
$('.showTitleBox').remove();
} else if (type == 'mousemove') {
$('.showTitleBox').css({
top: top + 10,
left: left
})
}
})

其中

border: '1px solid #00cccc', // 边框
borderRadius: '5px',         // 边框圆角
background: "#00cccc",      // 背景色
fontFamily: 'SimHei',           // 字体
fontSize: '15px'                  // 字体大小

原文地址:https://www.cnblogs.com/Williamls/p/11446075.html