从右下角出来的广告实例_js代码
2008-01-28 15:59
295 查看
//<![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!=-1) return;
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)+'px';
}
el.style.height=popupFeetWinactualHgt+'px';
}
function popupFeetWinespopup_tmrHideTimer()
...{
clearInterval(popupFeetWintmrHide); popupFeetWintmrHide=-1;
el=document.getElementById('popupFeetWin');
if (popupFeetWinhasFilters)
...{
backCnt=document.getElementById('popupFeetWin_content').innerHTML;
backTit=document.getElementById('popupFeetWin_header').innerHTML;
document.getElementById('popupFeetWin_content').innerHTML='';
document.getElementById('popupFeetWin_header').innerHTML='';
el.style.filter='blendTrans(duration=1)';
el.filters.blendTrans.apply();
el.style.visibility='hidden';
el.filters.blendTrans.play();
document.getElementById('popupFeetWin_content').innerHTML=backCnt;
document.getElementById('popupFeetWin_header').innerHTML=backTit;
popupFeetWindxTimer=setInterval(popupFeetWinespopup_dxTimer,1000);
}
else el.style.visibility='hidden';
}
function popupFeetWinespopup_dxTimer()
...{
clearInterval(popupFeetWindxTimer); popupFeetWindxTimer=-1;
}
function popupFeetWinespopup_Close()
...{
if (popupFeetWintmrId==-1)
...{
el=document.getElementById('popupFeetWin');
el.style.filter='';
el.style.display='none';
if (popupFeetWintmrHide!=-1) clearInterval(popupFeetWintmrHide); popupFeetWintmrHide=-1;
}
}
function popupFeetWinespopup_ShowWindow()
...{
if (popupFeetWinnWin!=null) popupFeetWinnWin.close();
popupFeetWinnWin=window.open('','popupFeetWinnWin','width=300,height=200,scrollbars=no, '+
'menubar=no, resizable=no, status=no, toolbar=no, location=no');
popupFeetWinnWin.document.write(popupFeetWinnText);
}
var popupFeetWinmousemoveBack,popupFeetWinmouseupBack;
var popupFeetWinofsX,popupFeetWinofsY;
function popupFeetWinespopup_DragDrop(e)
...{
popupFeetWinmousemoveBack=document.body.onmousemove;
popupFeetWinmouseupBack=document.body.onmouseup;
ox=(e.offsetX==null)?e.layerX:e.offsetX;
oy=(e.offsetY==null)?e.layerY:e.offsetY;
popupFeetWinofsX=ox; popupFeetWinofsY=oy;
document.body.onmousemove=popupFeetWinespopup_DragDropMove;
document.body.onmouseup=popupFeetWinespopup_DragDropStop;
if (popupFeetWintmrHide!=-1) clearInterval(popupFeetWintmrHide);
}
function popupFeetWinespopup_DragDropMove(e)
...{
el=document.getElementById('popupFeetWin');
if (e==null&&event!=null)
...{
el.style.left=(event.clientX*1+document.body.scrollLeft-popupFeetWinofsX)+'px';
el.style.top=(event.clientY*1+document.body.scrollTop-popupFeetWinofsY)+'px';
event.cancelBubble=true;
}
else
...{
el.style.left=(e.pageX*1-popupFeetWinofsX)+'px';
el.style.top=(e.pageY*1-popupFeetWinofsY)+'px';
e.cancelBubble=true;
}
if ((event.button&1)==0) popupFeetWinespopup_DragDropStop();
}
function popupFeetWinespopup_DragDropStop()
...{
document.body.onmousemove=popupFeetWinmousemoveBack;
document.body.onmouseup=popupFeetWinmouseupBack;
}
//]]>
相关文章推荐
- 从右下角出来的广告实例_js代码
- JS随机漂浮广告代码具体实例
- JS随机漂浮广告代码具体实例
- 纯js代码生成可搜索选择下拉列表的实例
- PHP随机生成广告图片的实例 代码
- JS实现很实用的对联广告代码(可自适应高度)
- 分享JS广告代码 如sina 163 首页平铺瞬间消失的那种
- js迭代table表格的行和列代码实例
- Vue.js上下滚动加载组件的实例代码
- js实现ArrayList功能附实例代码
- js 左右悬浮对联广告代码示例
- JS 树形递归实例代码
- js 左右悬浮对联广告代码示例
- js实现页面打印功能实例代码(附去页眉页脚功能代码)
- js实例代码
- js导入导出excel(实例代码)
- JS 精确统计网站访问量的实例代码
- 基于js实现投票的实例代码
- js鼠标、键盘事件实例代码