招商联系客服 全国楼凤小姐姐 招商联系客服 招商联系客服 招商联系客服 招商联系客服

jquery实现网页顶部定时广告,支持关闭隐藏

[复制链接]
查看93 | 回复0 | 2024-10-27 12:09:07 | 显示全部楼层 |阅读模式
598d29ef1cdc0237.jpg


以上只是部份演示图片,详细可以付费购买。
[HTML] 纯文本查看 复制代码
<!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>jquery实现网页顶部定时广告,支持关闭隐藏</title>
<script type="text/javascript" src="//xcdn.php.cn/js/ads/jquery实现网页顶部定时广告,支持关闭隐藏/js/jquery.js"></script>
</head>

<body>

<style type="text/css">
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
body{min-width:1007px;font:12px/1.5 tahoma,sans-serif;}
.advbox{position:relative;margin:0px auto;width:980px;background:#e8e8e8}
.advbox .advbtn{position:absolute;width:19px;display:none;height:55px;top:10px;right:-23px}
.advbox .advbtn a{display:block;background:url(images/gg_btn.png) no-repeat 0px 0px;height:55px;overflow:hidden}
.advbox .advbtn .advclose{background:url(images/gg_btn.png) no-repeat -19px 0px;}
.advbox .advcon{display:none;height:400px;}
</style>

<div class="advbox">

	<div class="advbtn">
		<a style="display:none" class="advreplay" title="重播" href="javascript:void(0);"></a>

		<a class="advclose" title="关闭" href="javascript:void(0);"></a>
	</div>
	
	<div class="advcon"></div>

</div><!--advbox end-->


<script type="text/javascript">
//首页大广告
var gg960ShowTime = 10000; //播放时间
var gg960Time = null;

function open_gg960(showBtn){
    $('.advbox .advcon').html(gg960Con).slideDown(300,function(){
        if(showBtn !== false){
            $('.advbox .advbtn').fadeIn();
        }
        if(gg960Time){clearTimeout(gg960Time);}
        gg960Time = setTimeout(close_gg960,gg960ShowTime);
    });
}
function close_gg960(){
    $('.advbox .advcon').slideUp(500,function(){
        $(this).html('');
        $('.advclose').hide();
        $('.advreplay').show();
    });
}
$('.advclose').click(function(){
    if(gg960Time){clearTimeout(gg960Time);}
    close_gg960();
    return false;
});
$('.advreplay').click(function(){
    if(gg960Time){clearTimeout(gg960Time);}
    open_gg960(false);
    $('.advreplay').hide();
    $('.advclose').show();
    return false;
});

var gg960Con;
var fullAdType = 'swf';
var fullAdUrl = '跳转域名'
var fullAdName = '//xcdn.php.cn/js/ads/jquery实现网页顶部定时广告,支持关闭隐藏/images/qpad.swf';;
if(fullAdName){
	if(fullAdType == 'swf'){
		gg960Con = '<embed wmode="transparent" height="400" width="980" flashvars="alink1='+fullAdUrl+'" allowscriptaccess="always" quality="high" name="Advertisement" id="Advertisement" style="" src="//xcdn.php.cn/js/ads/jquery实现网页顶部定时广告,支持关闭隐藏/images/qpad.swf" type="application/x-shockwave-flash"></embed>';
		
	}else{
		gg960Con = '<a href="'+fullAdUrl+'" target="_blank"><img width="980" height="400" src="//xcdn.php.cn/js/ads/jquery实现网页顶部定时广告,支持关闭隐藏/images/qpad.jpg"/></a>';//flash无法显示时,显示JPG广告
	}
	
	setTimeout(open_gg960,1500);//延迟显示
}
</script>

</body>
</html>

以上代码中的图片和JS,请下载到自己网站目录中使用!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则