close

提示方塊的內容,還可加入隔行語法,顏色及字型大小語法,甚至可加入圖片。

<script language=JavaScript>
function display_popup(FUNC, POP_MSG) {
if(!POP_MSG) {
 document.getElementById("POP_MSG").style.display = "none";
} else {
 if(!FUNC) FUNC = window.event;
 if(!FUNC) return;
 var x = FUNC.clientX;
 var y = FUNC.clientY + document.body.scrollTop;
 document.getElementById("POP_MSG").innerHTML = POP_MSG;
 document.getElementById("POP_MSG").style.left = (x+30)+"px";
 document.getElementById("POP_MSG").style.top = (y+10)+"px";
 document.getElementById("POP_MSG").style.display = "block";
 }
}
</script>
<div id="POP_MSG" style="display:none; padding:5px ;position:absolute; left:0px; top:0px; z-index:1;border:1px solid #888888;background-color:#EEEEEE;"></div>



首先要加入以上必要語法,以上語法最底,可找到設定

padding:5px ; 是內容與方塊四周距離 
border:1px solid #888888; 是方塊邊框大小及顏色 
background-color:#EEEEEE; 是方塊背景顏色


再用以下各款語法,加到想做到這效果的文字或圖片之內
語法中  這裏輸入指向時彈出方塊內容的文字
可使用隔行語法 <br> 或 <p>
可使用字型大小及顏色語法 <font size=3 color=red>文字</font>
緊記:這位置加入的語法,不可使用 " 或 ' 這類符號
<table width=300> 是控制彈出方塊的闊度 

<span onmouseover="display_popup(event,'<table width=300><tr><td>這裏輸入指向時彈出方塊內容的文字</td></tr></table>')" onmouseout="display_popup(event,0)">這裏是正常顯示的文字</span>

arrow
arrow
    全站熱搜

    Cat Yee 發表在 痞客邦 留言(1) 人氣()