mirror of https://github.com/vtrois/kratos
chore: merge duplicate codes (#405)
parent
b5c76af8a1
commit
3f2a855b91
|
@ -22,18 +22,15 @@
|
|||
var gotopConfig = function () {
|
||||
$(window).on("load", function () {
|
||||
var $win = $(window);
|
||||
if ($win.scrollTop() > 200) {
|
||||
$(".gotop").addClass("active");
|
||||
} else {
|
||||
$(".gotop").removeClass("active");
|
||||
}
|
||||
$win.scroll(function () {
|
||||
var setShowOrHide = function(){
|
||||
if ($win.scrollTop() > 200) {
|
||||
$(".gotop").addClass("active");
|
||||
} else {
|
||||
$(".gotop").removeClass("active");
|
||||
}
|
||||
});
|
||||
}
|
||||
setShowOrHide();
|
||||
$win.scroll(setShowOrHide);
|
||||
});
|
||||
$(".gotop").on("click", function (event) {
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue