星火官网,前端页面(前台)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. $(function () {
  2. $(".header_root").load("./sections/comm/header.html");
  3. $(".footer_root").load("./sections/comm/footer.html");
  4. // nav传值显示下划线
  5. $(".header_root").data("nav_info", null);
  6. $(".scheme_left_btn").click(function () {
  7. window.location.href = "/sections/product.html";
  8. });
  9. let _homeSwiperTimer = null;
  10. let homeSwiper = new Swiper(".home_swiper_container.swiper-container", {
  11. loop: true,
  12. autoplay: 5000,
  13. // 如果需要分页器
  14. pagination: ".swiper-pagination",
  15. autoplayDisableOnInteraction : false,
  16. paginationType: "custom",
  17. onSlideChangeStart: function(_swiper){
  18. if (_homeSwiperTimer) {
  19. clearInterval(_homeSwiperTimer);
  20. }
  21. $(".home_swiper_pagination .pagination_item_progress").each(function(i, element){
  22. element.style.width = "0%";
  23. });
  24. },
  25. onSlideChangeEnd: function(_swiper){
  26. if (_homeSwiperTimer) {
  27. clearInterval(_homeSwiperTimer);
  28. }
  29. let _width = 0;
  30. _homeSwiperTimer = setInterval(function() {
  31. _width += 1;
  32. if ($(".home_swiper_pagination .pagination_item_progress")[_swiper.realIndex]) {
  33. $(".home_swiper_pagination .pagination_item_progress")[_swiper.realIndex].style.width = _width + "%";
  34. if (_width === 100 && _homeSwiperTimer) {
  35. clearInterval(_homeSwiperTimer);
  36. }
  37. }
  38. }, 50);
  39. }
  40. });
  41. });