2 sxh2213499 sxh2213499 于 2014.08.14 10:32 提问

DIV 弹出层没办法实现

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



Insert title here #popupcontent{ position: absolute; visibility: hidden; overflow: hidden; border:1px solid #CCC; background-color:#F9F9F9; border:1px solid #333; padding:5px;} var baseText = null; function showPopup(w,h){ ar popUp = document.getElementById("popupcontent"); popUp.style.top = "200px"; popUp.style.left = "200px"; popUp.style.width = w + "px"; popUp.style.height = h + "px"; if (baseText == null) baseText = popUp.innerHTML; popUp.innerHTML = baseText + "<div id=/"statusbar/"><input type=/"button/" value=/"Closewindow/" onClick=/"hidePopup()/"></div>"; var sbar = document.getElementById("statusbar"); sbar.style.marginTop = (parseInt(h)-60) + "px"; popUp.style.visibility = "visible"; } function hidePopup() { var popUp = document.getElementById("popupcontent"); popUp.style.visibility = "hidden"; }



这是一个DIV弹窗效果!

将鼠标移动到此


点击这里查看弹出窗口



请帮忙看下代码有什么问题没

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!