修复两栏布局不能固定 #profile 的问题 (#320)
This commit is contained in:
parent
29235f6d3a
commit
a4ef07b8c4
|
@ -43,23 +43,21 @@
|
|||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// To Top & Fixed Profile
|
||||
// To Top
|
||||
var sidebarElem = $('#sidebar'),
|
||||
toTopElem = $('#toTop');
|
||||
|
||||
if (sidebarElem.length) {
|
||||
checkDisplayToTop();
|
||||
checkFixedProfile();
|
||||
(function () {
|
||||
if (!sidebarElem.length) return;
|
||||
|
||||
checkDisplayToTop();
|
||||
$(document).on('scroll', function () {
|
||||
checkDisplayToTop();
|
||||
checkFixedProfile();
|
||||
});
|
||||
|
||||
toTopElem.click(function () {
|
||||
$('body, html').animate({ scrollTop: 0 }, 600);
|
||||
});
|
||||
}
|
||||
|
||||
var isToTopDisplayed = false;
|
||||
function checkDisplayToTop() {
|
||||
|
@ -83,6 +81,14 @@
|
|||
toTopElem.css('right', 20);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
// Fixed Profile
|
||||
(function () {
|
||||
checkFixedProfile();
|
||||
$(document).on('scroll', function () {
|
||||
checkFixedProfile();
|
||||
});
|
||||
|
||||
var isFixedProfile = false;
|
||||
function checkFixedProfile() {
|
||||
|
@ -115,5 +121,6 @@
|
|||
isFixedProfile = false;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
})(jQuery);
|
||||
|
|
Loading…
Reference in New Issue