Skip to content

Instantly share code, notes, and snippets.

@HyunsDev
Created December 19, 2020 14:01
Show Gist options
  • Save HyunsDev/adac081e7c1b56274d199333ddff7eb7 to your computer and use it in GitHub Desktop.
Save HyunsDev/adac081e7c1b56274d199333ddff7eb7 to your computer and use it in GitHub Desktop.
let is_line_open = false;
let line_scroll = () => {
// $(".debug").text($(this).scrollTop() + " " + is_line_open)
if ($(this).scrollTop() > 335) { //열기
if (is_line_open) {
// console.log("already open");
is_line_open = true;
} else {
$(".write_line_box_2").removeClass("hide");
$(".write_line_box_background").removeClass("background_hide");
console.log("open")
is_line_open = true;
}
} else { //닫기
if (!is_line_open) {
// console.log("already close");
is_line_open = false;
} else {
$(".write_line_box_2").addClass("hide");
$(".write_line_box_background").addClass("background_hide");
console.log("close");
is_line_open = false;
}
}
}
$(window).on("scroll", function(){
var windowWidth = $( window ).width();
if(windowWidth < 768) {
line_scroll()
}
});
$(window).load(function(){
var msnry = new Masonry( '.lines', {
itemSelector: '.line',
columnWidth: 315
});
new WOW().init();
line_scroll()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment