這不是一個按鈕的問題頁面必須完全加載之前,按鈕甚至出現。
該按鈕工作正常,我沒有刷新頁面,我只是等待,直到頁面完全加載前滾動下來。
而且在一個側面說明,我使用谷歌瀏覽器
,如果你不使用該瀏覽器比它可能是與瀏覽器的IM注意到火炬的問題呈現你的頁面了很多問題,但話又說回來火炬總是有問題
編輯:
移動這個
<script>
jQuery(document).ready(function() {
var offset = 220;
var duration = 500;
jQuery(window).scroll(function() {
if (jQuery(this).scrollTop() > offset) {
jQuery('.back-to-top').fadeIn(duration);
} else {
jQuery('.back-to-top').fadeOut(duration);
}
});
jQuery('.back-to-top').click(function(event) {
event.preventDefault();
jQuery('html, body').animate({scrollTop: 0}, duration);
return false;
})
});
</script>
到head標籤<head> </head>
之前日Ë</head>
編輯2:
mkay我想我看到那裏的主要問題是 當主第一次加載頁面它不把很多腳本,在所有 專門
<script src="js/jquery.djax.min.js"></script>
<script src="js/jquery.nicescroll.min.js"></script>
<script src="js/jquery.ba-throttle-debounce.min.js"></script>
<script src="js/transit.js"></script>
<script src="js/jquery.cycle.all.min.js"></script>
<script src="js/jquery.maximage.min.js"></script>
<script src="js/jquery.colorbox-min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/main.js"></script>
IM注意到當這些不加載按鈕不會顯示 你應該做到這一點,以便這些腳本在開始加載,而不是當它進入菜單頁面,因爲這些腳本只有當你直接加載菜單部分刷新時才顯示移動thos e腳本到頁面的頭部,因爲它們顯然是需要的im不知道哪些是需要的,但在這一點上它們應該定義在頭標記中而不是在身體中以防止它們不被加載
編輯3 :
變化
<script>
jQuery(document).ready(function() {
var offset = 220;
var duration = 500;
jQuery(window).scroll(function() {
if (jQuery(this).scrollTop() > offset) {
jQuery('.back-to-top').fadeIn(duration);
} else {
jQuery('.back-to-top').fadeOut(duration);
}
});
jQuery('.back-to-top').click(function(event) {
event.preventDefault();
jQuery('html, body').animate({scrollTop: 0}, duration);
return false;
})
});
</script>
到
<script>
jQuery(window).load(function() {
var offset = 220;
var duration = 500;
jQuery(window).scroll(function() {
if (jQuery(this).scrollTop() > offset) {
jQuery('.back-to-top').fadeIn(duration);
} else {
jQuery('.back-to-top').fadeOut(duration);
}
});
jQuery('.back-to-top').click(function(event) {
event.preventDefault();
jQuery('html, body').animate({scrollTop: 0}, duration);
return false;
})
});
</script>
讓我知道,如果這有助於與否
編輯4:
嘗試移動<a href="#" class="back-to-top">Back to Top</a>
直接上面</body>
編輯5:
要求回答這個問題,發現問題後also is <a href="#" class="back-to-top">Back to Top</a> in index.php at all or is it only in menu.php
是,這是不是在的index.php並需要在那裏移動
您能發送測試鏈接嗎? – sinisake
發佈那些你正在使用的代碼,同時顯示你的網站破壞或http://jsfiddle.net/將幫助人們幫你 – Andrew
鏈接添加到問題。 – Tirolel