JS代码:
// 定义一些变量
//获得窗口的高度
var windowHeight;
//获得窗口的宽度
var windowWidth;
//获得弹窗的高度
var popHeight;
//获得弹窗的宽度
var popWidth;
// 获取滚动条滚动的高度
var scrollTop;
//获取滚动条滚动的宽度
var scrollLeft;
//延迟时间
var timeout;
function init(){
windowHeight=$(window).height();
windowWidth=$(window).width();
popHeight=$(".window").height();
popWidth=$(".window").width();
scrollTop=$(window).scrollTop();
scrollLeft=$(window).scrollLeft();
}
//关闭窗口的方法
function closeWindow(){
//找到X号的图片,加单击事件,并且关闭窗口
$(".title img").click(function (){
$(this).parent().parent().hide("slow");
});
}
//定义弹出居中窗口的方法
function popCenterWindow