简要咨询咨询QQ网站导航网站搜索手机站点联系我们设为首页加入收藏 

将discuz x2返回顶部的按钮x1.5中实现步骤

来源:易贤网   阅读:1093 次  日期:2016-06-18 09:39:04

温馨提示:易贤网小编为您整理了“将discuz x2返回顶部的按钮x1.5中实现步骤”,方便广大网友查阅!

很多人都想让x2中的返回顶部移动到1.5上,那么下面我就教大家如何将这个功能移动到1.5上。

首先打开x2安装包你需要讲一下几处的代码移动到 1.5中。

1.打开x2中的./static/js/common.js找到这段js函数将它复制到x1.5中的./static/js/common.js文件底部。

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';

}

}

}

2.找到x2中的./template/default/common/footer.htm,将以下代码

<span id=scrolltop>{lang scrolltop}</span>

<script type=text/javascript>_attachevent(window, 'scroll', function(){showtoplink();});</script>

复制到x1.5中的./template/default/common/footer.htm文件中的<!--{eval output();}-->这段代码的上面。

3.找到找到x2中的./template/default/common/common.css,将以下代码

#scrolltop { visibility: hidden; position: fixed; bottom: 100px; display: block; margin: -30px 0 0; width: 26px; height: 50px; background: url({imgdir}/scrolltop.png) no-repeat 50% 0; line-height: 999px; overflow: hidden; cursor: pointer; }

.ie6 #scrolltop { position: absolute; bottom: auto; }

复制到x1.5中的./template/default/common/common.css文件中.

4.找到找到x2中的./static/image/common/scrolltop.png复制到x1.5中的./static/image/common/文件中.

然后更新缓存。前台刷新页面看看吧

更多信息请查看CMS教程
点此处就本文及相关问题在本站进行非正式的简要咨询(便捷快速)】     【点此处查询各地各类考试咨询QQ号码及交流群
上一篇:discuz和jquery变量名冲突的3种解决方法
下一篇:hotnews pro博客布局排除分类文章
易贤网手机网站地址:将discuz x2返回顶部的按钮x1.5中实现步骤
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
相关阅读      CMS教程