从右下角出来的广告实例_js代码

本文介绍了一种使用JavaScript实现的弹窗动画效果,通过定时器逐步展示弹窗,并调整其高度以达到平滑过渡的效果。该方法兼容多种浏览器,包括Opera。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

//<![CDATA[

              
var popupFeetWinoldonloadHndlr=window.onload, popupFeetWinpopupHgt, popupFeetWinactualHgt, popupFeetWintmrId=-1, popupFeetWinresetTimer;

              
var popupFeetWintitHgt, popupFeetWincntDelta, popupFeetWintmrHide=-1, popupFeetWinhideAfter=30000, popupFeetWinhideAlpha, popupFeetWinhasFilters=true;

              
var popupFeetWinnWin, popupFeetWinshowBy=null, popupFeetWindxTimer=-1, popupFeetWinpopupBottom;

              
var popupFeetWinnText,popupFeetWinnMsg,popupFeetWinnTitle,popupFeetWinbChangeTexts=false;

              window.onload
=popupFeetWinespopup_winLoad;



              
var popupFeetWinoldonscrollHndr=window.onscroll;

              window.onscroll
=popupFeetWinespopup_winScroll;

              popupFeetWinnText
="";



              
function popupFeetWinespopup_winScroll()

              
...{

               
if (popupFeetWinoldonscrollHndr!=null) popupFeetWinoldonscrollHndr();

               
if (popupFeetWintmrHide!=-1)

               
...{

                     el
=document.getElementById('popupFeetWin');

                     el.style.display
='none'; el.style.display='block';

               }


              }




              
function popupFeetWinespopup_ShowPopup(show)

              
...{

               
if (popupFeetWindxTimer!=-1...{ el.filters.blendTrans.stop(); }



               
if ((popupFeetWintmrHide!=-1&& ((show!=null&& (show==popupFeetWinshowBy)))

               
...{

                     clearInterval(popupFeetWintmrHide);

                     popupFeetWintmrHide
=setInterval(popupFeetWinespopup_tmrHideTimer,popupFeetWinhideAfter);

                     
return;

               }


               
if (popupFeetWintmrId!=-1return;

               popupFeetWinshowBy
=show;



               elCnt
=document.getElementById('popupFeetWin_content')

               elTit
=document.getElementById('popupFeetWin_header');

               el
=document.getElementById('popupFeetWin');

               el.style.left
='15';

               el.style.top
='';

               el.style.filter
='';



               
if (popupFeetWintmrHide!=-1) clearInterval(popupFeetWintmrHide); popupFeetWintmrHide=-1;



               document.getElementById(
'popupFeetWin_header').style.display='none';

               document.getElementById(
'popupFeetWin_content').style.display='none';



               
if (navigator.userAgent.indexOf('Opera')!=-1)

                     el.style.bottom
=(document.body.scrollHeight*1-document.body.scrollTop*1

                                                 
-document.body.offsetHeight*1+1*popupFeetWinpopupBottom)+'px';



               
if (popupFeetWinbChangeTexts)

               
...{

                     popupFeetWinbChangeTexts
=false;

                     document.getElementById(
'popupFeetWinaCnt').innerHTML=popupFeetWinnMsg;

                     document.getElementById(
'popupFeetWintitleEl').innerHTML=popupFeetWinnTitle;

               }




               popupFeetWinactualHgt
=0; el.style.height=popupFeetWinactualHgt+'px';

               el.style.visibility
='';

               
if (!popupFeetWinresetTimer) el.style.display='';

               popupFeetWintmrId
=setInterval(popupFeetWinespopup_tmrTimer,(popupFeetWinresetTimer?1000:20));

              }




              
function popupFeetWinespopup_winLoad()

              
...{

               
if (popupFeetWinoldonloadHndlr!=null) popupFeetWinoldonloadHndlr();



               elCnt
=document.getElementById('popupFeetWin_content')

               elTit
=document.getElementById('popupFeetWin_header');

               el
=document.getElementById('popupFeetWin');

               popupFeetWinpopupBottom
=el.style.bottom.substr(0,el.style.bottom.length-2);



               popupFeetWintitHgt
=elTit.style.height.substr(0,elTit.style.height.length-2);

               popupFeetWinpopupHgt
=el.style.height;

               popupFeetWinpopupHgt
=popupFeetWinpopupHgt.substr(0,popupFeetWinpopupHgt.length-2); popupFeetWinactualHgt=0;

               popupFeetWincntDelta
=popupFeetWinpopupHgt-(elCnt.style.height.substr(0,elCnt.style.height.length-2));



               
if (true)

               
...{

                     popupFeetWinresetTimer
=true;

                     popupFeetWinespopup_ShowPopup(
null);

               }


              }




              
function popupFeetWinespopup_tmrTimer()

              
...{

               el
=document.getElementById('popupFeetWin');

               
if (popupFeetWinresetTimer)

               
...{

                     el.style.display
='';

                     clearInterval(popupFeetWintmrId); popupFeetWinresetTimer
=false;

                     popupFeetWintmrId
=setInterval(popupFeetWinespopup_tmrTimer,20);

               }


               popupFeetWinactualHgt
+=5;

               
if (popupFeetWinactualHgt>=popupFeetWinpopupHgt)

               
...{

                     popupFeetWinactualHgt
=popupFeetWinpopupHgt; clearInterval(popupFeetWintmrId); popupFeetWintmrId=-1;

                     document.getElementById(
'popupFeetWin_content').style.display='';

                     
if (popupFeetWinhideAfter!=-1) popupFeetWintmrHide=setInterval(popupFeetWinespopup_tmrHideTimer,popupFeetWinhideAfter);

               }


               
if (popupFeetWintitHgt<popupFeetWinactualHgt-6)

                     document.getElementById(
'popupFeetWin_header').style.display='';

               
if ((popupFeetWinactualHgt-popupFeetWincntDelta)>0)

               
...{

                     elCnt
=document.getElementById('popupFeetWin_content')

                     elCnt.style.display
='';

                     elCnt.style.height
=(popupFeetWinactualHgt-popupFeetWincntDelta)+'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值