首先開啟 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/檔案中.
然後更新快取。前臺重新整理頁面看看吧