js 回到顶部,急求 传送门:http://topic.csdn.net/u/20110421/11/5d31f9b6-1e3a-4072-9ae3-221f7e132f51.html?seed=1631784350&r=72901726#r_72901726 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script type="text/javascript"><!--var w = 90;var h = 100;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:30px;font-size:16px;overflow:hidden;font-weight:bold;text-align:left;"><a href="javascript:scroll(0,0)" hidefocus="true"><img src="http://hotel.114.com.hk/images/detail_btn_goTop.gif" alt="回到顶部" style="border: 0px;" /></a></div> ');document.write('<div style="clear:both;margin:auto;overflow:hidden;text-align:left;">'+str+'</div>');document.writeln('</DIV>');--></script>参考 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><script>function goto(position){ if(position=="bottom") { document.documentElement.scrollTop=document.body.clientHeight; document.body.scrollTop=document.body.clientHeight; } if(position=="top") { document.documentElement.scrollTop=0; document.body.scrollTop=0; }}</script></head><body><input type="button" value="到页面底端" onclick="goto('bottom')" /><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/><input type="button" value="到页面顶端" onclick="goto('top')" /></body></html> 关于跟踪客户端唯一信息的问题,在线等急++++++++++++++++++++++++++++++++++++ 问个关于droplist的问题 GridView怎么绑定数组 求URL传两个值的标准语法~问题很短! datalist 数据绑定 怎样在DetailsView进行插入时进行验证 请教 asp.net 网站Session问题 想做个简单的电子地图! button的click事件和command事件有什么区别啊? crystal report 高手請進!!! 关于三层架构的问题 asp 用户控件消失
var w = 90;
var h = 100;
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:30px;font-size:16px;overflow:hidden;font-weight:bold;text-align:left;"><a href="javascript:scroll(0,0)" hidefocus="true"><img src="http://hotel.114.com.hk/images/detail_btn_goTop.gif" alt="回到顶部" style="border: 0px;" /></a></div> ');
document.write('<div style="clear:both;margin:auto;overflow:hidden;text-align:left;">'+str+'</div>');
document.writeln('</DIV>');
-->
</script>参考
<html>
<head>
<script>
function goto(position)
{
if(position=="bottom")
{
document.documentElement.scrollTop=document.body.clientHeight;
document.body.scrollTop=document.body.clientHeight;
}
if(position=="top")
{
document.documentElement.scrollTop=0;
document.body.scrollTop=0;
}
}
</script>
</head>
<body>
<input type="button" value="到页面底端" onclick="goto('bottom')" />
<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/>
<input type="button" value="到页面顶端" onclick="goto('top')" />
</body>
</html>