//----- -----------------------tooltip effect start------------------------- ---------- //Get the position of an html element function GetPos(obj){ var pos=new Object(); pos.x=obj .offsetLeft; pos.y=obj.offsetTop; while(obj=obj.offsetParent){ pos.x =obj.offsetLeft; pos.y =obj.offsetTop; } return pos; };
//Tip Tool var ToolTip={ _tipPanel:null, Init:function(){ if (null==this._tipPanel){ var tempDiv=document.createElement("div"); document.body.insertBefore(tempDiv, document.body.childNodes[0]); tempDiv. id="tipPanel"; tempDiv.style.display="none"; tempDiv.style.position="absolute"; tempDiv.style.zIndex="999"; } }, AttachTip:function(){}, //Add tip binding DetachTip:function(){}, //Remove tip binding ShowTip:function(oTarget){ if($("tipPanel")==null) return;
/*Operation process *1. Build a new html fragment *2. Set a new prompt box Position *3, display prompt box */ //1. var tempStr=""; //html fragment if(arguments.length>1){ for(var i=1;itempStr ="
The above $("id") is equivalent to document.getElementById("id") AttachTip:function(){}, //Add prompt binding DetachTip:function(){} , //Remove the two lines of prompt binding , which can be completed using dynamic binding events. Because they are not needed in the project, they are not added yet.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn