fix go back top button
This commit is contained in:
parent
9803817926
commit
c025ed45a5
|
@ -328,7 +328,8 @@
|
|||
// 回到頁面最頂端,動態產生DOM
|
||||
// txt = 按鈕的文字, speed = 捲動時的速度
|
||||
goBackTop: function(txt, speed) {
|
||||
var top = document.createElement('div');
|
||||
var top = document.createElement('a');
|
||||
top.href = '#gotocenter';
|
||||
top.className = 'go-back-top no-print';
|
||||
top.textContent = txt || 'top';
|
||||
doc.body.appendChild(top);
|
||||
|
@ -348,17 +349,14 @@
|
|||
|
||||
|
||||
// 捲動效果
|
||||
$('.go-back-top').on('click', function() {
|
||||
$('.go-back-top, .top').on('click', function() {
|
||||
$('body, html').animate({
|
||||
scrollTop: 0
|
||||
}, speed || 300);
|
||||
return false;
|
||||
});
|
||||
$('.top').on('click', function() {
|
||||
$('body, html').animate({
|
||||
scrollTop: 0
|
||||
}, speed || 300);
|
||||
return false;
|
||||
}, speed || 300, "swing", function(){
|
||||
window.setTimeout(function(){
|
||||
open_kenjoh(true);
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue