main.js 2.1 KB

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