jquery广告控制flash图片顶部显示隐藏插件


jquery广告控制flash图片顶部显示隐藏插件
jquery广告控制flash图片顶部显示隐藏插件以及广告控制flash、图片顶部、显示隐藏等js/jquery网页特效代码下载。

1. 引入JS

<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>

2. HTML代码

<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 = 'http://www.51qianduan.com/'
var fullAdName = '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="images/qpad.swf" type="application/x-shockwave-flash"></embed>';
	}else{
		gg960Con = '<a href="'+fullAdUrl+'" target="_blank"><img width="980" height="400" src="images/qpad.jpg"/></a>';//flash无法显示时,显示JPG广告
	}
	setTimeout(open_gg960,1500);//延迟显示
}
</script>

相关推荐

发表评论

相关文章