|
|
@@ -28,85 +28,6 @@ $(document).ready(function() {
|
|
|
}, 50);
|
|
|
});
|
|
|
|
|
|
- var lastScrollTop = 0;
|
|
|
- $(window).on('mousewheel',function(e){
|
|
|
- if($('body').hasClass('gnb_on') === false && $('main').hasClass('pd') === false){
|
|
|
- var wheel = e.originalEvent.wheelDelta;
|
|
|
- if(wheel>0){
|
|
|
- //스크롤 올릴때
|
|
|
- $(".tabbar").addClass('fixed');
|
|
|
- $(".gnb").addClass('fixed');
|
|
|
- $(".pnb_mo").addClass('fixed');
|
|
|
- $("header").css("display", "block");
|
|
|
- $("header").css("position", "fixed");
|
|
|
- if($(".gnb").hasClass("fixed")){
|
|
|
- $("header").css("display", "none");
|
|
|
- }
|
|
|
- if($(".pnb_mo").hasClass("fixed")){
|
|
|
- $("header").css("display", "none");
|
|
|
- }
|
|
|
- if($(window).scrollTop() < 10){
|
|
|
- $(".gnb").css('position', 'relative');
|
|
|
- $(".pnb_mo").css('position', 'relative');
|
|
|
- $("header").css("position", "relative");
|
|
|
- $("header").css("display", "block");
|
|
|
- } else {
|
|
|
- $(".gnb").css('position', 'fixed');
|
|
|
- $(".pnb_mo").css('position', 'fixed');
|
|
|
- }
|
|
|
- } else {
|
|
|
- //스크롤 내릴때
|
|
|
- $(".tabbar").removeClass('fixed');
|
|
|
- $(".pnb_mo").addClass('fixed');
|
|
|
- $(".pnb_mo").css('position', 'fixed');
|
|
|
- $(".gnb").addClass('fixed');
|
|
|
- $(".gnb").css('position', 'fixed');
|
|
|
- $("header").css("display", "none");
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- $(window).on('mousewheel',function(e){
|
|
|
- if($('header').hasClass('main') === true){
|
|
|
- var wheel = e.originalEvent.wheelDelta;
|
|
|
- if(wheel>0){
|
|
|
- //스크롤 올릴때
|
|
|
- $(".tabbar").addClass('fixed');
|
|
|
- $(".gnb").addClass('fixed');
|
|
|
- $(".gnb").css("top", "5.5rem");
|
|
|
- $(".pnb_mo").addClass('fixed');
|
|
|
- $("header").css("display", "block");
|
|
|
- $("header").css("position", "fixed");
|
|
|
- if($(".gnb").hasClass("fixed")){
|
|
|
- $("header").css("display", "none");
|
|
|
- }
|
|
|
- if($(".pnb_mo").hasClass("fixed")){
|
|
|
- $("header").css("display", "none");
|
|
|
- }
|
|
|
- if($(window).scrollTop() < 10){
|
|
|
- $(".gnb").css('position', 'relative');
|
|
|
- $(".pnb_mo").css('position', 'relative');
|
|
|
- $("header").css("position", "relative");
|
|
|
- $("header").css("display", "block");
|
|
|
- $(".bnrtype_banner").css("z-index", "999");
|
|
|
- $(".bnrtype_banner").css("top", "5.5rem");
|
|
|
- $("main.container").css("margin-top", "5.5rem");
|
|
|
- } else {
|
|
|
- $(".gnb").css('position', 'fixed');
|
|
|
- $(".pnb_mo").css('position', 'fixed');
|
|
|
- }
|
|
|
- } else {
|
|
|
- //스크롤 내릴때
|
|
|
- $(".bnrtype_banner").css("z-index", "0");
|
|
|
- $(".gnb").css("top", "0");
|
|
|
- $(".tabbar").removeClass('fixed');
|
|
|
- $(".pnb_mo").addClass('fixed');
|
|
|
- $(".pnb_mo").css('position', 'fixed');
|
|
|
- $(".gnb").addClass('fixed');
|
|
|
- $(".gnb").css('position', 'fixed');
|
|
|
- $("header").css("display", "none");
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
$(window).scroll(function (event) {
|
|
|
|
|
|
// header height 가 아닌, 스크롤 감지로 변경할 것
|
|
|
@@ -380,6 +301,71 @@ $( document ).ready( function() {
|
|
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * */
|
|
|
$(document).ready(function () {
|
|
|
+ //210525_마우스 휠을 스크롤 이벤트로 변경 및 3가지 경우의 수 헤더 정리
|
|
|
+ var lastScrollTop = 0;
|
|
|
+ $(window).scroll(function (event) {
|
|
|
+ //경우1 : only htopMain
|
|
|
+ if($('section').is('#htopMain') === true && $('div').is('#gnb') === false){
|
|
|
+ console.log("vvvv");
|
|
|
+ var commonSt = $(this).scrollTop();
|
|
|
+ //스크롤 올릴때
|
|
|
+ if (commonSt > lastScrollTop) {
|
|
|
+ $("header").css('display', 'none');
|
|
|
+ $("header").css('position', 'fixed');
|
|
|
+ $(".tabbar").removeClass("fixed");
|
|
|
+ //스크롤 내릴때
|
|
|
+ } else {
|
|
|
+ $("header").css('display', 'block');
|
|
|
+ $("header").css('position', 'fixed');
|
|
|
+ $(".tabbar").addClass("fixed");
|
|
|
+ }
|
|
|
+ lastScrollTop = commonSt;
|
|
|
+ //경우2 : htopMian + gnb
|
|
|
+ } else if($('section').is('#htopMain') === true && $('div').is('#gnb') === true) {
|
|
|
+ console.log("bvbb");
|
|
|
+ var commonSt = $(this).scrollTop();
|
|
|
+ //스크롤 올릴때
|
|
|
+ if (commonSt > lastScrollTop) {
|
|
|
+ $("header").css('display', 'none');
|
|
|
+ $("header").css('position', 'fixed');
|
|
|
+ $("#gnb").css('display', 'block');
|
|
|
+ $("#gnb").css('position', 'fixed');
|
|
|
+ $("#gnb").css('top', '0');
|
|
|
+ $(".tabbar").removeClass("fixed");
|
|
|
+ $("section.content, section.main, .bnrtype_banner").addClass('scr');
|
|
|
+ //스크롤 내릴때
|
|
|
+ } else {
|
|
|
+ $("header").css('display', 'block');
|
|
|
+ $("header").css('position', 'fixed');
|
|
|
+ $("#gnb").css('display', 'block');
|
|
|
+ $("#gnb").css('position', 'fixed');
|
|
|
+ $("#gnb").css('top', '55px');
|
|
|
+ $(".tabbar").addClass("fixed");
|
|
|
+ $("section.content, section.main, .bnrtype_banner").removeClass('scr');
|
|
|
+ }
|
|
|
+ lastScrollTop = commonSt;
|
|
|
+ //경우3 : only htopSub
|
|
|
+ } else {
|
|
|
+ var commonSt = $(this).scrollTop();
|
|
|
+ $("header").css('display', 'block');
|
|
|
+ $("header").css('position', 'fixed');
|
|
|
+ //스크롤 올릴때
|
|
|
+ if (commonSt > lastScrollTop) {
|
|
|
+ $(".tabbar").removeClass("fixed");
|
|
|
+ //스크롤 내릴때
|
|
|
+ } else {
|
|
|
+ $(".tabbar").addClass("fixed");
|
|
|
+ }
|
|
|
+ lastScrollTop = commonSt;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //210525_초기화 시 top:0 이동
|
|
|
+ window.onload = function() {
|
|
|
+ setTimeout (function () {
|
|
|
+ scrollTo(0,0);
|
|
|
+ },1);
|
|
|
+ }
|
|
|
+
|
|
|
// GNB
|
|
|
$(".btn_gnb").on("click", function () {
|
|
|
$(this).toggleClass("on");
|
|
|
@@ -803,83 +789,6 @@ $(document).ready(function () {
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
- // 210407_사이즈 선택유지 스크립트
|
|
|
- //$('.option_box .form_field div label').click(function(){
|
|
|
- // var a = [];
|
|
|
- // a = document.querySelectorAll(".option_box .form_field div label span");
|
|
|
- // sizeLine = document.querySelectorAll(".option_box .form_field div label");
|
|
|
- // sizeGap = this.innerText;
|
|
|
-
|
|
|
- // if(sizeGap === "90"){
|
|
|
- // for(var i=0; i<a.length; i++){
|
|
|
- // sizeLine[i].style.border="1px solid #ddd";
|
|
|
- // if(a[i].innerText === "90"){
|
|
|
- // sizeLine[i].style.border="1px solid #fd4802";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if(sizeGap === "95"){
|
|
|
- // for(var i=0; i<a.length; i++){
|
|
|
- // sizeLine[i].style.border="1px solid #ddd";
|
|
|
- // if(a[i].innerText === "95"){
|
|
|
- // sizeLine[i].style.border="1px solid #fd4802";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if(sizeGap === "100"){
|
|
|
- // for(var i=0; i<a.length; i++){
|
|
|
- // sizeLine[i].style.border="1px solid #ddd";
|
|
|
- // if(a[i].innerText === "100"){
|
|
|
- // sizeLine[i].style.border="1px solid #fd4802";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if(sizeGap === "105"){
|
|
|
- // for(var i=0; i<a.length; i++){
|
|
|
- // sizeLine[i].style.border="1px solid #ddd";
|
|
|
- // if(a[i].innerText === "105"){
|
|
|
- // sizeLine[i].style.border="1px solid #fd4802";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if(sizeGap === "110"){
|
|
|
- // for(var i=0; i<a.length; i++){
|
|
|
- // sizeLine[i].style.border="1px solid #ddd";
|
|
|
- // if(a[i].innerText === "110"){
|
|
|
- // sizeLine[i].style.border="1px solid #fd4802";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if(sizeGap === "115"){
|
|
|
- // for(var i=0; i<a.length; i++){
|
|
|
- // sizeLine[i].style.border="1px solid #ddd";
|
|
|
- // if(a[i].innerText === "115"){
|
|
|
- // sizeLine[i].style.border="1px solid #fd4802";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if(sizeGap === "free"){
|
|
|
- // for(var i=0; i<a.length; i++){
|
|
|
- // sizeLine[i].style.border="1px solid #ddd";
|
|
|
- // if(a[i].innerText === "free"){
|
|
|
- // sizeLine[i].style.border="1px solid #fd4802";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- //});
|
|
|
-
|
|
|
- // 210407_텍스트 카운팅
|
|
|
- //$('.doc_itemqna').keyup(function (e){
|
|
|
- // var content = $(this).val();
|
|
|
- // $('#itemqna_cnt').html("<em class='c_primary'>"+content.length+"</em>/500자");//글자수 실시간 카운팅
|
|
|
-
|
|
|
- // if (content.length > 200){
|
|
|
- // mcxDialog.alert("최대 500자까지 입력 가능합니다."); //210420_수정 : 시스템 alert -> dialog 변경.
|
|
|
- // $(this).val(content.substring(0, 500));
|
|
|
- // $('#itemqna_cnt').html("<em class='c_primary'>500</em>/500자");
|
|
|
- // }
|
|
|
- //});
|
|
|
-
|
|
|
// 210407_스크롤감지 헤더 그림자
|
|
|
$('.pd_delivery_pop').scroll(function(){
|
|
|
$(".pd_delivery_pop .modal-header").css("box-shadow", "rgb(0 0 0 / 20%) 0px 0px 5px");
|
|
|
@@ -1024,18 +933,15 @@ $( document ).ready( function() {
|
|
|
// $("body").css({"overflow":"visible"});
|
|
|
// })
|
|
|
|
|
|
- $(window).on('mousewheel',function(e){
|
|
|
- var wheel = e.originalEvent.wheelDelta;
|
|
|
- //스크롤값을 가져온다.
|
|
|
- if(wheel>0){
|
|
|
- //스크롤 올릴때
|
|
|
- $("header").css('display', 'block');
|
|
|
- $("header").css('position', 'fixed');
|
|
|
- } else {
|
|
|
- //스크롤 내릴때
|
|
|
- $("header").css('display', 'none');
|
|
|
- $("header").css('position', 'fixed');
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
+ //$(window).on('scroll',function(e){
|
|
|
+ // var wheel = e.originalEvent.wheelDelta;
|
|
|
+ // if(wheel>0){
|
|
|
+ // $("header").css('display', 'block');
|
|
|
+ // $("header").css('position', 'fixed');
|
|
|
+ // } else {
|
|
|
+ // $("header").css('display', 'none');
|
|
|
+ // $("header").css('position', 'fixed');
|
|
|
+ // }
|
|
|
+ //});
|
|
|
+
|
|
|
});
|