網上找了半天,結果發現使用z-index是沒有用的,最後還是參考了網上的例子,使用一個iframe來擋住selected達到div不被selected擋住的效果
參見代碼:
< div id ="msgdiv" style ="position:absolute; top:129px; left:229px; z-index:1;" >
< table width ="300" border ="0" cellspacing ="1" cellpadding ="2" class ="tb_table" >
< tr class ="tb_detailtr" >
< td class ="tb_td_sheng" >< span style ="float:right" onClick ="javascript:closemsg();" onMouseMove ="this.style.cursor='hand';" >< img src ="../images/icon/icon_list_close.gif" title ="關閉" ></ span >< img src ="../images/icon/Info.gif" >< strong > 系統資訊 </ strong ></ td >
</ tr >
< tr >
< td class ="tb_td_qian color_blue font_bold" style ="font-size:14px;" height ="120" align ="center" >< bean:write name ="msgsus" /></ td >
</ tr >
</ table >
</ div >
// 關的時候兩個都要關
function closemsg() ... {
document.getElementById('msgdiv').style.display='none';
document.getElementById('msgiframe').style.display='none';
}