鼠标经过的字符都显示在状态栏上
发布时间:2008-12-20 阅读数: 次 来源:网乐原科技
要完成此效果把如下代码加入到区域中
function doMouseMove() {
var tr = document.body.createTextRange();
tr.moveToPoint(event.clientX, event.clientY);
// Expand to the entire word under the mouse.
tr.expand("word");
window.status = tr.text;
}
document.onmousemove = doMouseMove;