main.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. var onitirDoc;
  2. (function($) {
  3. 'use strict';
  4. onitirDoc = {
  5. init: function() {
  6. this.slider();
  7. this.mobileMenu();
  8. this.productGird();
  9. },
  10. // Slider
  11. slider: function() {
  12. var bannerSlider = $('#bannerSlider');
  13. if (!bannerSlider.length) {
  14. return;
  15. }
  16. bannerSlider.on('beforeChange', function(e, slick, currentSlide, nextSlide) {
  17. });
  18. bannerSlider.slick({
  19. infinite: false,
  20. dots: true,
  21. variableWidth: false,
  22. arrows: false,
  23. autoplaySpeed: 5000,
  24. autoplay: true,
  25. cssEase: 'linear',
  26. // fade: true,
  27. // cssEase: 'ease'
  28. });
  29. },
  30. // Mobile Menu
  31. mobileMenu: function() {
  32. $('.mainmenu-area .main-menu .menu-items').meanmenu({
  33. meanMenuContainer: '.mobile-menu',
  34. meanScreenWidth: '991',
  35. meanRevealPosition: 'right',
  36. });
  37. },
  38. // Porduct Grid
  39. productGird: function() {
  40. var grid = jQuery('.grid-isotope');
  41. if (!grid.length) {
  42. return;
  43. }
  44. grid.isotope();
  45. jQuery('.grid-filter ul').on('click', 'li', function() {
  46. var filterValue = jQuery(this).attr('data-filter');
  47. grid.isotope({ filter: filterValue });
  48. });
  49. jQuery('.grid-filter ul li').on('click', function(event) {
  50. jQuery(this).siblings('.active').removeClass('active');
  51. jQuery(this).addClass('active');
  52. event.preventDefault();
  53. });
  54. }
  55. };
  56. // Document Ready
  57. $(document).ready(function() {
  58. onitirDoc.init();
  59. });
  60. $(window).on('scroll', function() {
  61. // Sticky Header
  62. var scroll = $(window).scrollTop();
  63. if (scroll < 110) {
  64. $('header.sticky-header').removeClass('sticky');
  65. } else {
  66. $('header.sticky-header').addClass('sticky');
  67. }
  68. })
  69. })(jQuery)
  70. function toTrade() {
  71. window.location.href = "./trade/index.html"
  72. }
  73. function toNews() {
  74. window.location.href = "../../news/index.html"
  75. }