网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 将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/文件中.
    然后更新缓存。前台刷新页面看看吧
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/20 11:07:06