通过js实现在网页右下角弹出一个留言本弹窗特效,这个留言本特效兼容性很好,可根据网页颜色自己修改样式,带缩小按钮。
<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <script type="text/javascript"> window.onresize = baiduResizeDiv; window.onerror = function(){} var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0; var px = document.doctype?"px":0; var scrollwidth = navigator.userAgent.indexOf("Firefox")>0?16:0; var iframeheight = navigator.userAgent.indexOf("MSIE")>0?230-2:209-2; String.prototype.Trim = function(){return this.replace(/^\s+|\s+$/g,"");} function baidu_collapse(obj){ ct = document.getElementById('tab_c_iframe'); if(ct.style.display=="none"){ ct.style.display=""; obj.src=obj.src.replace("b.gif","a.gif"); } else { ct.style.display="none"; obj.src=obj.src.replace("a.gif","b.gif"); } baiduResizeDiv(); } //武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) function baiduMsg() { try{ divTop = parseInt(document.getElementById("eMeng").style.top,10); divLeft = parseInt(document.getElementById("eMeng").style.left,10); divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10); divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10); var scrollPosTop,scrollPosLeft,docWidth,docHeight; if (typeof window.pageYOffset != 'undefined') { scrollPosTop = window.pageYOffset; scrollPosLeft = window.pageXOffset; docWidth = window.innerWidth; docHeight = window.innerHeight; } else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { scrollPosTop = document.documentElement.scrollTop; scrollPosLeft = document.documentElement.scrollLeft; docWidth = document.documentElement.clientWidth; docHeight = document.documentElement.clientHeight; } else if (typeof document.body != 'undefined') { scrollPosTop = document.body.scrollTop; scrollPosLeft = document.body.scrollLeft; docWidth = document.body.clientWidth; docHeight = document.body.clientHeight; } document.getElementById("eMeng").style.top = parseInt(scrollPosTop,10) + docHeight + 10 + px;// divHeight document.getElementById("eMeng").style.left = parseInt(scrollPosLeft,10) + docWidth - divWidth - scrollwidth + px; document.getElementById("eMeng").style.visibility="visible"; objTimer = window.setInterval("baidu_move_div()",10); }catch(e){} } //武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) function baiduResizeDiv() { i+=1; try{ divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10); divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10); var scrollPosTop,scrollPosLeft,docWidth,docHeight; if (typeof window.pageYOffset != 'undefined') { scrollPosTop = window.pageYOffset; scrollPosLeft = window.pageXOffset; docWidth = window.innerWidth; docHeight = window.innerHeight; } else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { scrollPosTop = document.documentElement.scrollTop; scrollPosLeft = document.documentElement.scrollLeft; docWidth = document.documentElement.clientWidth; docHeight = document.documentElement.clientHeight; } else if (typeof document.body != 'undefined') { scrollPosTop = document.body.scrollTop; scrollPosLeft = document.body.scrollLeft; docWidth = document.body.clientWidth; docHeight = document.body.clientHeight; } document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(scrollPosTop,10) + px; document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(scrollPosLeft,10) - scrollwidth + px; }catch(e){} } //武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) function baidu_move_div() { var scrollPosTop,scrollPosLeft,docWidth,docHeight; if (typeof window.pageYOffset != 'undefined') { scrollPosTop = window.pageYOffset; scrollPosLeft = window.pageXOffset; docWidth = window.innerWidth; docHeight = window.innerHeight; } else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { scrollPosTop = document.documentElement.scrollTop; scrollPosLeft = document.documentElement.scrollLeft; docWidth = document.documentElement.clientWidth; docHeight = document.documentElement.clientHeight; } else if (typeof document.body != 'undefined') { scrollPosTop = document.body.scrollTop; scrollPosLeft = document.body.scrollLeft; docWidth = document.body.clientWidth; docHeight = document.body.clientHeight; } //武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) try{ if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(scrollPosTop,10))) { window.clearInterval(objTimer);objTimer = window.setInterval("baiduResizeDiv()",1); } divTop = parseInt(document.getElementById("eMeng").style.top,10); document.getElementById("eMeng").style.top = divTop - 1 + px; }catch(e){} } function wuming_ren(shape,color,userid){ var styles='position:absolute;top:0px;left:0px;z-index:99999;visibility:hidden;'; var copic='<img src="/img/20240412_www_wuming_ren_3_'+color+'b.gif" align="absmiddle" class="ioc'+color+'" onClick="baidu_collapse(this)">'; if(shape>1) window.onload = baiduMsg; else {styles='';copic=''} var s; if(shape==2) { s='<div id=eMeng style="Z-INDEX:99999;LEFT:0px;POSITION:absolute;TOP:0px;VISIBILITY:hidden;">' + '<table width="216" border="0" cellpadding="0" cellspacing="0" class="" id="tab_'+(color+3)+'" style="border:0px;">' +'<tr>' +'<td align="right"></td>' +'</tr>' +' <tr>' +' <td><table width="100%" border="0" cellspacing="0" cellpadding="0">' +' <tr>' +' <td width="32" rowspan="2" valign="bottom"><img src="/img/20240412_www_wuming_ren_3_'+(color+1)+'.gif"></td>' +' <td> </td>' +' </tr>' +' <tr>' +' <td align=right style="font-size:12px; background:url(/img/20240412_www_wuming_ren_4_'+color+'.gif);line-height:21px;height:21px;border-top:1px solid #808080;border-right:1px solid #808080;padding-right:6px;color:#FFFFFF;" onDblClick="baidu_collapse(this.firstChild.nextSibling)"><font color="#FFFFFF">留言板</font></a> <img src="/img/20240412_www_wuming_ren_3_'+color+'a.gif" align="absmiddle" class="ioc'+color+'" onClick="baidu_collapse(this)">' +' </td>' +' </tr>' +' </table>' +' </td>' +' </tr>' +'' +'' +'' +'' +'' + '</table>' + '<iframe src="/img/20240412_www_wuming_ren_5.html" width="216" height="' + iframeheight + '" frameborder="0" id="tab_c_iframe"></iframe>' +'' +'</div>'; } else if(shape==3) { s='<div id=eMeng style="width:100%;background:#FFFFFF;'+styles+'">' +' <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #808080;" id="tab_'+color+'">' +' <tr>' +' <td colspan="3" align=right style="font-size:12px; background:url(/img/20240412_www_wuming_ren_4_'+color+'.gif);line-height:19px;height:19px;padding-right:6px;color:#FFFFFF;" onDblClick="baidu_collapse(this.firstChild.nextSibling)">留言板'+copic +'</tr>' +' </tr>' + '</table>' + '<iframe src="bottom.html?userid=' +userid+ '" width="100%" height="85" frameborder="0" id="tab_c_iframe"></iframe>' +'</div>'; } document.writeln(s); } //武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) wuming_ren(2,1, 849620); </script>
本文来自武鸣人网站,转载请注明出处