定义和用法

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'                  // 字体大小

相关文章:

  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2021-04-09
  • 2021-04-11
  • 2022-12-23
  • 2021-04-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案