|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
我找了它的源码,有三个地方,一是底部
<span id="scrolltop" onclick="window.scrollTo('0','0')">回顶部</span>
<script type="text/javascript">_attachEvent(window, 'scroll', function(){showTopLink();});</script>
二是函数:function showTopLink() {
if($('ft')){
var viewPortHeight = parseInt(document.documentElement.clientHeight);
var scrollHeight = parseInt(document.body.getBoundingClientRect().top);
var basew = parseInt($('ft').clientWidth);
var sw = $('scrolltop').clientWidth;
if (basew < 1000) {
var left = parseInt(fetchOffset($('ft'))['left']);
left = left < sw ? left * 2 - sw : left;
$('scrolltop').style.left = ( basew + left ) + 'px';
} else {
$('scrolltop').style.left = 'auto';
$('scrolltop').style.right = 0;
}
if (BROWSER.ie && BROWSER.ie < 7) {
$('scrolltop').style.top = viewPortHeight - scrollHeight - 150 + 'px';
}
if (scrollHeight < -100) {
$('scrolltop').style.visibility = 'visible';
} else {
$('scrolltop').style.visibility = 'hidden';
}
}
}
三是css:
#scrolltop { visibility: hidden; position: fixed; bottom: 100px; display: block; margin: -30px 0 0; width: 26px; height: 50px; background: url(images/scrolltop.png) no-repeat 50% 0; line-height: 999px; overflow: hidden; cursor: pointer; }
.ie6 #scrolltop { position: absolute; bottom: auto; }
结果却没有反应,不知问题在那里?
|
|