標籤:style class blog java get width
//imgFrame顯示層,imgbox顯示的內容
<div id="imgFrame"> <div><a href="javascript:close();">關閉</a></div> <div id="imgbox"></div> </div>
//img路徑 <img src=‘<%#(Eval("picture","{0}").ToString()=="")?"../images/noimg.gif":Eval("picture")%>‘ width="90" height="50" onclick="showOriginal(‘<%#Eval("picture")%>‘,event);">//層的關閉按鈕方法function close() { document.getElementById("imgFrame").style.display = "none"; } //層顯示的方法function showOriginal(img,e) {// document.getElementById("imgFrame").style.top = mousePos(e).x;// document.getElementById("imgFrame").style.left = mousePos(e).y;// document.getElementById("imgFrame").style.zIndex=1000;// document.getElementById("imgFrame").style.position = "absolute"; if(img != "" && img != null) { document.getElementById("imgFrame").style.display = "block"; document.getElementById("imgbox").innerHTML = "<img src=‘" + img + "‘ width=\"500\" height=\"500\" />"; } else { document.getElementById("imgFrame").style.display = "block"; document.getElementById("imgbox").innerHTML = "<img src=‘../images/noimg.gif‘ width=\"500\" height=\"500\" />"; }}