真爱无限的知识驿站

学习积累技术经验,提升自身能力

js行背景变色、显示提示层的代码

JS代码:

function showHelp(id) {  

    var obj = document.getElementById(id);  

    obj.style.display = "";  

    obj.style.left = event.x;  

    obj.style.top = event.y;  

}  

function hideHelp(id) {  

    var obj = document.getElementById(id);  

    obj.style.display = "none";  

}  

//<div id="tooltip1" style="position:absolute;display:none; z-index: 1000; border: solid 1px black;padding: 10px; background: white;">提示</div>  

// onmouseover="showHelp('tooltip1');" onmouseout="hideHelp('tooltip1');"   

var c;  

function cc(obj) {  

    c = obj.style.backgroundColor;  

    obj.style.backgroundColor = '#E7EDFE'  

}  

function cc1(obj) {  

    obj.style.backgroundColor = c;  

}  

// onmouseover="cc(this)" onmouseout="cc1(this)"  



发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.7.3

Copyright 2024-2027 pukuimin Rights Reserved.
粤ICP备17100155号