| <script type="text/javascript"> | |
| var w = 100; | |
| var h = 60; | |
| var str = ""; | |
| var obj = document.getElementById("divStayTopLeft"); | |
| if (obj)str = obj.innerHTML; | |
| if( typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat'){ | |
| document.writeln('<DIV style="z-index:9;right:0;bottom:0;height:'+h+'px;width:'+w+'px;overflow:hidden;POSITION:fixed;_position:absolute; _margin-top:expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);">'); | |
| } | |
| else { | |
| document.writeln('<DIV style="z-index:9;right:0;bottom:0;height:'+h+'px;width:'+w+'px;overflow:hidden;POSITION:fixed;*position:absolute; *top:expression(eval(document.body.scrollTop)+eval(document.body.clientHeight)-this.style.pixelHeight);">'); | |
| } | |
| document.writeln('<div style="clear:both;margin:auto;height:50px;font-size:16px;overflow:hidden;font-weight:bold;text-align:left;"><a href="javascript:scroll(0,0)" hidefocus="true"><img id="imgTop" onclick="Contextdisplay(/'imgTop/');" src="skin/default/jooyea/images/up.gif" alt="回到顶部" title="回到顶部" style="border:0;" /></a></div> '); | |
| document.write('<div style="clear:both;margin:auto;overflow:hidden;text-align:left;">'+str+'</div>'); | |
| document.writeln('</DIV>'); | |
| function Contextdisplay(whichID){ | |
| document.getElementById(whichID).src='skin/default/jooyea/images/up1.gif'; | |
| setTimeout("Contextdisplay1(/'imgTop/')",500); | |
| } | |
| function Contextdisplay1(whichID){ | |
| document.getElementById(whichID).src='skin/default/jooyea/images/up.gif' | |
| } | |
| </script> |

本文介绍了一种使用JavaScript和HTML实现网页底部固定悬浮按钮的方法,包括兼容不同浏览器的解决方案。
1016

被折叠的 条评论
为什么被折叠?



