一个网站顶部广告

前两天广告部的同事要上一个广告,一说要求 都写过N次了 干脆写一个固定下来 省的每次都写一遍

 打开首页后广告拉下,显示一段时间后自动卷上去 再打个XX 可以关闭就行了 

具体代码如下:

$(function(){
            
var projad={
                adtimer:
false,
                playtim:
10000,//显示时间(ms)按需调整
                projdiv:$("#projection"),
                showprj:
function(){
                    projad.projdiv.slideDown(
1000);
                    projad.sethide();
                },
                hideprj:
function(){
                    projad.projdiv.slideUp(
800);
                    projad.clearhide();
                },
                sethide:
function(){
                    projad.adtimer
=setTimeout(projad.hideprj,projad.playtim);
                },
                clearhide:
function(){
                    
if(projad.adtimer){
                        clearTimeout(projad.adtimer);
                        projad.adtimer
=false;
                    }
                }
            }
            projad.showprj();
            
//projad.projdiv.hover(function(){projad.clearhide();},function(){projad.sethide();})
            $("#xcls").click(function(){
                projad.hideprj();
            })
            
        })

 

 

例子见:

http://nba.titan24.com/focus/kikx/topad_demo.html 

 

posted on 2010-02-22 14:31  trance  阅读(324)  评论(0编辑  收藏  举报

导航