可关闭两边飘浮对联广告代码jquery特效宽屏显示

2025-03-25 19:47:56
推荐回答(1个)
回答1:








#ad1,#ad2{
    -webkit-transition: all .5s ease-out;
    -moz-transition: all .5s ease-out;
    -o-transition: all .5s ease-out;
    transition: all .5s ease-out;
    POSITION:absolute;
    TOP:120px;
    width:100px;
    height:200px;
    border:1px solid red;
}
#close1,#close2{
font-size:10px;
background:gray;
float:right;
}
#close1:hover,#close2:hover{cursor:pointer}







关闭



关闭






$("#close1").click(function(){ //关闭广告
$(this).parent().remove();
})
$("#close2").click(function(){
$(this).parent().remove();
})
document.onscroll=function(){ //滑动保持广告位置

$("#ad1").style.top=document.body.scrollTop+120+'px';
$("#ad2").style.top=document.body.scrollTop+120+'px';

};


 

相关问答
最新问答