如下: 複製程式碼 程式碼如下: <BR> .toopTip<BR> {<BR> solid;<BR> border-width:1px;<BR> border-color:Red; <BR> }<BR> <BR> 上方邊界與顯示的div重疊,那麼需要刪除文件頭W3C標準<BR> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transition xhtml1/DTD/xhtml1-transitional.dtd"><BR><BR> */<BR> 中音🎜> for (var i = 0; i < divArray.length; i ) {<br> divArray[i].onmouseover = createDivDetailOne 以原始的div綁定滑鼠移除的事件,因為明細的div的寬度長度都要大於原始div,<br> //divArray[i].onmouseout = removeDivDetail;<BR> }<BR> }<BR> function createDivDetailOne() {<BR> ent.getElementById("divDetail");<BR> if(divDetail)<BR> {<BR> document.body.removeChild(divDetail);<BR> }<BR> divObj = document.createElement("div");<BR> bute("id", "divDetail");<BR> divObj.style.position = "absolute";<BR> divObj.style.width = "200px";<BR> var triggerObj = window.event.srcElement;<BR> divObj.style.top = triggerObj.offsetTop;<BR> divObj.style.left = triggerObj.offsetLeft;<BR> document.body.appendChild(divObj);<BR> //此時用於明細的div已經涵蓋了原始div,所以涵蓋的div要進行事件的處理<BR> document.getElementById("divDetail").onmouseout = function() {<> > if (!divObj ) {<BR> return;<BR> .removeChild(divObj);<BR> };<BR> }<BR> = document.getElementById( "divDetail");<BR> if (!divObj) {<BR> document.body.removeChild(divObj);<BR> }<BR> <BR><BR> window.onload = initEvent;<BR> > >