<style type="text/css">
*{margin:0;padding:0;list-style-type:none;}
body{font:12px/180% Arial, Helvetica, sans-serif,"宋体";}
a,img{border:0;}
a{color:#5e5e5e;text-decoration:none;}
a:hover{color:#3366cc;text-decoration:underline;}
/* box */
.box{position:absolute;width:600px;left:50%;height:auto;z-index:100;background-color:#fff;border:1px #8FA4F5 solid;padding:1px;}
.box h2{height:25px;font-size:14px;background-color:#3366cc;position:relative;padding-left:10px;line-height:25px;color:#fff;}
.box h2 a{position:absolute;right:5px;font-size:12px;color:#fff;}
.box .mainlist{padding:10px;}
.box .mainlist li{height:24px;line-height:24px;}
.box .mainlist li span{margin:0 5px 0 0;font-family:"宋体";font-size:12px;font-weight:400;color:#ddd;}
#TB_overlayBG{background-color:#666;position:absolute;z-index:99;left:0;top:0;display:none;width:100%;height:100%;opacity:0.5;filter: alpha(opacity=50);-moz-opacity: 0.5;}
</style>
<script type="text/javascript">
$(function() {
$(".showbox").click(function() {
$("#TB_overlayBG").css({
display: "block", height: $(document).height()
});
$(".box").css({
left: ($("body").width() - $(".box").width()) / 2 - 20 + "px",
top: ($(window).height() - $(".box").height()) / 2 + $(window).scrollTop() + "px",
display: "block"
});
});
$(".close").click(function() {
$("#TB_overlayBG").css("display", "none");
$(".box ").css("display", "none");
});
})
</script>
</head>
<body>
<p align="center" style="font-size:18px;font-family:微软雅黑;margin:100px;"><a href="javascript:void(0);" class="showbox">jquery制作点击按钮弹出层</a></p>
<div >jquery 制作鼠标点击描点a标签返回顶部</a></li>
</ul>
</div>
</div>
</body>
</html>
//popup.js
(function() {
var ptype = 1;
function setcookie(cName, cExpires) {
var zbj_ad_pop_cookie_time;
try {
zbj_ad_pop_cookie_time = parseFloat(cExpires) * 1;
}
catch (e) {
zbj_ad_pop_cookie_time = 60 * 60;
}
if (isNaN(zbj_ad_pop_cookie_time))
zbj_ad_pop_cookie_time = 60 * 60;
var then = new Date();
then.setTime(then.getTime() + zbj_ad_pop_cookie_time * 1000);
document.cookie = cName + '=1;expires=' + then.toGMTString() + ';path=/;';
}
function upcookie(cname, ctime) {
setcookie(cname, ctime);
}
var state = 0;
; (function() {
var d = navigator.userAgent;
var a = {};
a.ver = {
ie: /MSIE/.test(d),
ie6: !/MSIE 7\.0/.test(d) && /MSIE 6\.0/.test(d) && !/MSIE 8\.0/.test(d),
tt: /TencentTraveler/.test(d),
i360: /360SE/.test(d),
sogo: /; SE/.test(d),
gg: window.google && window.chrome,
_v1: '<object );
}