星期日, 4月 17, 2005
CSS & Mozilla
今日改自己個Web Favorities System, 發現Mozilla 0.95以前的版本都不支援position:fixed的CSS設定
最後又要大改一場, 終於搞掂~
貼上Javascript+CSS給大家參考吧~
最後又要大改一場, 終於搞掂~
貼上Javascript+CSS給大家參考吧~
... <style> a.admtool { font-size: 9pt; } a.navi { font-size: x-small; line-height: 13px; text-decoration: underline overline; } .dh {display:none;} .dv {display:block;} .divNavi{ border: 0px; border-style: none; top: 20px; right: 0px; position: absolute; text-align: center; padding: 2px; filter:alpha(opacity=70); -moz-opacity:0.7; } </style> <script> var ie=window.clipboardData var ns4=document.layers?1:0 var ns6=document.getElementById&&!document.all?1:0 var opera=window.opera?1:0 var geckoCSS2=(navigator.userAgent.indexOf("Gecko/")!=-1?navigator.userAgent.substr(navigator.userAgent.indexOf("Gecko/")+6,8):0)>=20011011?1:0; function moveNavi() { var offsetTop = 20; if (ie) { divNavi.style.pixelTop = document.body.scrollTop + offsetTop; divNavi.style.pixelLeft = document.body.clientWidth + document.body.scrollLeft - divNavi.offsetWidth - offsetTop; } else if (ns6||opera) { var obj = document.getElementById("divNavi"); if (!(geckoCSS2||opera)) obj.style.top=window.pageYOffset+offsetTop; else { obj.style.right="12px"; obj.style.position="fixed"; } } else if (ns4) { eval(document.divNavi.top=eval(window.pageYOffset+offsetTop)); } setTimeout("moveNavi()",100); //IEでスレが大きい場合CPUを食うようなので変更。 } </script> ... <body onload="moveNavi();"> ...
標籤: Programming, Web
發佈留言