common.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. 'use strict';
  2. //전역
  3. let _d = document,
  4. _w = window,
  5. _loc = location.href,
  6. _fullIdx = 0,
  7. event = {},
  8. __scrollCurrent = 0;
  9. /************************ jQuery fnc *****************************/
  10. (function ($) {
  11. event = {
  12. basic: {
  13. init: function () {
  14. // 스크립티 init
  15. event.basic.swiper();
  16. event.basic.hmbEvent();
  17. },
  18. hmbEvent : function(){
  19. $(".header--wrapper .header--contents .hmb--btn").on("click",function(){
  20. $("aside").toggleClass("actv");
  21. $("html, body").addClass("ovf");
  22. });
  23. $("aside .close--btn").on("click",function(){
  24. $("aside").toggleClass("actv");
  25. $("html, body").removeClass("ovf");
  26. });
  27. },
  28. swiper : function(){
  29. const swiper = new Swiper('.swiper.swp01', {
  30. loop: true,
  31. slidesPerView: "auto",
  32. spaceBetween: 20,
  33. pagination: {
  34. el: '.pagination--wraps.swp01',
  35. }
  36. });
  37. const swiper2 = new Swiper('.swiper.swp02', {
  38. loop: true,
  39. slidesPerView: "auto",
  40. spaceBetween: 20,
  41. pagination: {
  42. el: '.pagination--wraps.swp02',
  43. }
  44. });
  45. }
  46. }
  47. }
  48. })(jQuery);
  49. /************************ jQuery *****************************/
  50. $(function () {
  51. event.basic.init();
  52. });