index.js 864 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // 轮番图
  2. var swiper = new Swiper('.swiper-container', {
  3. slidesPerView: 'auto', //重要 可以去swiper搜索
  4. centeredSlides: true, //重要
  5. paginationClickable: true,
  6. spaceBetween: 10,
  7. effect: 'left',
  8. loop: true,
  9. pagination: {
  10. el: '.swiper-pagination',
  11. clickable: true,
  12. },
  13. autoplay: {
  14. disableOnInteraction: false, //手动滑动之后不打断播放
  15. delay: 5000
  16. },
  17. });
  18. // 显示顶部导航
  19. $(window).scroll(function() {
  20. var hT = $('.classified-nav').offset().top,
  21. hH = $('.classified-nav').outerHeight(),
  22. wS = $(this).scrollTop();
  23. if (wS > (hT+hH-60)){
  24. $(".nav").slideDown();
  25. }else{
  26. $(".nav").slideUp();
  27. }});
  28. // 底部广告关闭
  29. $(".adv-bottom .close").click(function(){
  30. $('.adv-bottom').fadeOut(500);
  31. setTimeout(function () {
  32. $(".footer").css("padding-bottom","0.25rem")
  33. }, 500);
  34. })