html javaScriptfunction secScroll(){ const screenHeight = document.documentElement.clientHeight; $(window).scroll(function(){ $('.item').each(function(){ let crtHeight = $(window).scrollTop(); // current scroll top let t..
swiper 속성 정리function eventSwiper(){ var eventSwiper = new Swiper('.event_swiper',{ slidesPerView : '2', // 노출되는 slide 개수 spaceBetween : 10, // 간격 loop:true, // 반복여부 loopAdditionalSlides : 1, direction: 'vertical', // slide 방향 autoHeight : true, // 높이 자동 조절 centeredSlides: true, centeredSlidesBounds: true, speed: 2500, grabC..
알럿창 버튼에 click event를 추가하기 위해 sweet alert 플러그인 사용 그런데 맥북 safari에서는 알럿창이 보이지 않는 이슈가 있었다찾아보니 해당 페이지의 맨 밑에 알럿창이 뜸.. css가 먹지 않는 것 같아 구글링을 하다가 stackoverflow에서 실마리를 찾음 sweet alert CDN 링크를 아래로 수정하니 해결되었다 ! *참고https://stackoverflow.com/questions/45476045/js-sweetalert2-not-working-in-safari-browser
Swiper.js에서 슬라이드 넘어갈 때 event 및 조건문 추가하는 방법 on에 이벤트 속성 삽입 후 event 또는 조건문의 내용 넣기 var mySwiper = new Swiper('.swiper-container', { slidesPerView: 'auto', centeredSlides: true, on: { slideChange : function() { // event }, }, }); * Swiper Event List init 슬라이드 쇼가 초기화될 때 slideChange 슬라이드가 변경될 때 slideChangeTransitionStart 슬라이드 변경 트랜지션 시작시 slideChangeTransitionEnd 슬라이드 변경 트랜지션 끝날 때 slideNextTransitionSta..
// responsive event let mql = window.matchMedia("screen and (max-width: 768px)"); if (mql.matches) { console.log('모바일'); } else { console.log('데스크탑'); } // resize event let mql = window.matchMedia("screen and (max-width: 768px)"); mql.addListener(function(e) { if(e.matches) { console.log('모바일'); } else { console.log('데스크탑'); } }); *참고 https://offbyone.tistory.com/122
브라우저의 높이값, 너비값 var documentHeight = (window.innerHeight || self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight); var documentWidth = (window.innerWidth || self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth);