main.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. var onitirDoc;
  2. (function($) {
  3. 'use strict';
  4. onitirDoc = {
  5. init: function() {
  6. this.mobileMenu();
  7. this.productGird();
  8. },
  9. // Mobile Menu
  10. mobileMenu: function() {
  11. $('.mainmenu-area .main-menu .menu-items').meanmenu({
  12. meanMenuContainer: '.mobile-menu',
  13. meanScreenWidth: '991',
  14. meanRevealPosition: 'right',
  15. });
  16. },
  17. // Porduct Grid
  18. productGird: function() {
  19. var grid = jQuery('.grid-isotope');
  20. if (!grid.length) {
  21. return;
  22. }
  23. grid.isotope();
  24. jQuery('.grid-filter ul').on('click', 'li', function() {
  25. var filterValue = jQuery(this).attr('data-filter');
  26. grid.isotope({ filter: filterValue });
  27. });
  28. jQuery('.grid-filter ul li').on('click', function(event) {
  29. jQuery(this).siblings('.active').removeClass('active');
  30. jQuery(this).addClass('active');
  31. event.preventDefault();
  32. });
  33. }
  34. };
  35. // Document Ready
  36. $(document).ready(function() {
  37. onitirDoc.init();
  38. });
  39. // Sticky Header
  40. $(window).on('scroll', function() {
  41. var scroll = $(window).scrollTop();
  42. if (scroll < 110) {
  43. $('header.sticky-header').removeClass('sticky');
  44. } else {
  45. $('header.sticky-header').addClass('sticky');
  46. }
  47. if (scroll > 700){
  48. $('#scroll-up').css({'visibility': 'visible','opacity':'1'});
  49. }else{
  50. $('#scroll-up').css({'visibility': 'hidden','opacity':'0'});
  51. }
  52. })
  53. })(jQuery)
  54. function toTrade() {
  55. window.location.href = "./trade/index.html"
  56. }
  57. function toNews() {
  58. window.location.href = "../../news/index.html"
  59. }