base.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. $(function () {
  2. // menu
  3. $(".m-header i").click(function () {
  4. $(".mob-navigation").addClass("on");
  5. $("body").css('overflowY','hidden');
  6. });
  7. $(".mob-navigation .home").click(function () {
  8. $(".mob-navigation").removeClass("on");
  9. $("body").css('overflowY','scroll');
  10. });
  11. $('.ziliao,.zixun').click(function () {
  12. document.getElementById('liuyanForm').reset();
  13. $(".spot-bg").css("display", "block");
  14. $('.fixed-foot').addClass('fixed-foot-on');
  15. })
  16. $(".spot-bg,.fixed-foot i").click(function () {
  17. $(".spot-bg").css("display", "none");
  18. $('.fixed-foot').removeClass('fixed-foot-on');
  19. })
  20. $(".trade-nav-l ul li").click(function(){
  21. var index = $(this).index();
  22. console.log(index)
  23. $(this).addClass('on').siblings().removeClass('on');
  24. $(".trade-nav-r .trade-list-box").eq(index).addClass('on').siblings().removeClass('on');
  25. })
  26. $("img.lazyload").lazyload();
  27. // 回顶部
  28. $('.go-top').click(function () {
  29. $('body,html').animate({ scrollTop: 0 });
  30. })
  31. $(window).scroll(function () {
  32. var oTop = document.body.scrollTop == 0 ? document.documentElement.scrollTop : document.body.scrollTop;
  33. if (oTop > 200) {
  34. $('.go-top').fadeIn();
  35. } else {
  36. $('.go-top').fadeOut();
  37. }
  38. })
  39. })