<div class="codetitle"> <span><a style="CURSOR: pointer" data="13132" class="copybut" id="copybut13132" onclick="doCopy('code13132')"><u>複製代碼</u></a></span> 代碼如下:</div> <div class="codebody" id="code13132"> <br>//W3C/1. Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><title>jquery彈出層實例</title> <br><script type="text/javascript" src="http://www.jqueryajax.com/wp-content/uploads/2009/03/jquery-132min1.js"></script> <br> <script type="text/javascript"> <BR>$(function(){ <BR>$(".but").click(function(){ <BR>var str = "這裡是資訊內容,這裡是資訊內容! )}); <BR>var yscroll =document.documentElement.scrollTop; <BR>$("#faqdiv").css("top","100px"); <BR>$("#faqdiv").css ("display","block"); <BR>document.documentElement.scrollTop=0; <BR>}); <BR>$(".close").click(function(){ <BR>$(" #faqbg").css("display","none"); <BR>$("#faqdiv").css("display","none"); <BR>}); <BR>}) <BR></script> <br><style type="text/css"> <BR>body,h2{margin:0 ; padding:0;} <BR>#faqbg{background-color:#666666; position: absolute; z-index:99; left:0; top:0; display:none; width:100%; height:1000px;opacity:0.5;filter: alpha(opacity=50);-moz-opacity: 0.5;filter: alpha(opacity=50);-moz-opacity: 0.5; <BR>#faqdiv{position:absolute;width:400px; left:50%; top:50%; margin-left:-200px; height:auto; z-index:100;background-color:#fff; border: 1px #8FA4F5 solid; padding:1px;} <BR>#faqdiv h2{ height:25px; font-size:14px; background-color:#8FA4F5; position:relative; padding-left:10px; lineFA4F5; position:relative; padding-left:10px; lineFA4F5; } <BR>#faqdiv h2 a{position:absolute; right:5px; font-size:12px; color:#FF0000} <BR>#faqdiv .form{padding:10px;} <BR></style> <br> <br><br> <br><br><div id="faqbg"></div> <br><div id="faqdiv" style="display:none"> <br><h2>訊息視窗<a href="#" class="close">關閉</a> </h2> <br><div class="form"> <br>這裡是提示訊息! ! <br><br> </div> <br> </div> <br><p align="center"> <br><input value="彈出" class="but" type="button"> <br><input type="button" value="關閉" class="close"> <br></p> <br> <br> <br><br> </div>