首页弹出大幅广告
作者:互联网
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="http://www.tgxrc.com/Css/global.css" rel="Stylesheet" />
<script type="text/javascript" src="http://www.tgxrc.com/Js/jQuery/jquery.last.min.js"></script>
<style type="text/css">
#popBigAd {width:760px;height:400px;}
#popBigAd img {width:760px;height:400px;border:none;}
#popBigAd #popBigAdClose,#popBigAd #popBigAdClose1{display:block;width:50px;text-align:center;cursor:pointer;position:absolute;right:5px;}
#popBigAd #popBigAdClose{height:50px;line-height:34px!important;*line-height:40px!important;line-height:40px;font-size:60px;background:#000;filter:alpha(opacity=30);-moz-opacity:0.3;-khtml-opacity: 0.3;opacity: 0.3;top:5px;}
#popBigAd #popBigAdClose1{height:26px;line-height:26px;font-size:20px;font-family:"Microsoft YaHei", SimHei;color:#71776a;top:55px;}
#popBigAd #popBigAdClose:hover,#popBigAd #popBigAdClose1:hover{text-decoration:none;}
</style>
</head>
<body>
</body>
</html>
<script type="text/javascript">
$(function () {
//首页弹出大幅广告
$(document).ready(function () {
$("body").append("<div id='popBigAd'><a id='popBigAdClose'>x</a><a id='popBigAdClose1'>关闭</a><a href='http://subject.gxrc.com/2014/cjmeet/info.aspx' target='_blank'><img src='http://image.gxrc.com/gxrcsite/ad/2014spring.gif' /></a></div>");
var popBigAd = $("#popBigAd");
var x = ($(window).width() - popBigAd.width()) / 2;
var y = ($(window).height() - popBigAd.height()) / 2;
popBigAd.css({ position: "absolute", top: y, left: x, "z-index": 9999 }).show();
var close = $("#popBigAdClose");
var close1 = $("#popBigAdClose1");
close.click(function () {
popBigAd.hide();
}).mouseover(function () {
$(this).css("color", "#ff9854");
close1.css("color", "#ff9854");
}).mouseout(function(){
$(this).css("color", "#b8c1ad");
close1.css("color", "#71776a");
});
close1.click(function () {
close.trigger("click");
}).mouseover(function () {
close.trigger("mouseover");
}).mouseout(function () {
close.trigger("mouseout");
});
setTimeout(function () {
popBigAd.hide();
}, 25000);
});
});
</script>
标签:function,color,height,width,大幅,首页,popBigAd,close,广告 来源: https://www.cnblogs.com/sunnywindycloudy/p/11646453.html