1003210180_edit.jsp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <script src="/main/dist/website/template/BNr02DHL36iU/plug-in/swiper@5.3.7/js/swiper.min.js"></script>
  2. <script src="/main/dist/website/template/BNr02DHL36iU/plug-in/js/jquery1.11.3.min.js"></script>
  3. <script src="/js/website.visit.js?v=20261111-visit-beacon" ></script>
  4. <script>
  5. // 轮播
  6. var swiper = new Swiper('.swiper-container', {
  7. spaceBetween: 30,
  8. effect: 'fade',
  9. loop: true,
  10. autoplay:true, //自动切换
  11. pagination: {
  12. el: '.swiper-pagination',
  13. clickable: true,
  14. },
  15. navigation: {
  16. nextEl: '.swiper-button-next',
  17. prevEl: '.swiper-button-prev',
  18. },
  19. });
  20. // 滚动跳转导航高度
  21. $(window).scroll(function() {
  22. if($(window).scrollTop() >= 30){
  23. $('.nav').css({
  24. "height": "50px",
  25. "line-height": "50px"
  26. });
  27. $(".nav-placeholder").css("height","50px");
  28. $(".nav-list").css("top","50px");
  29. }else{
  30. $('.nav').css({
  31. "height": "80px",
  32. "line-height": "80px"
  33. });
  34. $(".nav-placeholder").css("height","80px");
  35. $(".nav-list").css("top","80px");
  36. }
  37. });
  38. window.onload = function () {
  39. var imgHeight = $(".swiper-container").height();
  40. $(".banner").height(imgHeight);
  41. // 搜索
  42. $(".search-icon").click(function(){
  43. $(".search-wrap").slideDown(100);
  44. $(".search-wrap input").focus();
  45. })
  46. // 关闭搜索
  47. $(".search-close").click(function(){
  48. $(".search-wrap").slideUp(100);
  49. })
  50. // 搜索输入
  51. $(".search-wrap input").bind("input",function(){
  52. if($(this).val().length != 0){
  53. $(".search-wrap button").show();
  54. $(".search-wrap .search-close").hide();
  55. }else{
  56. $(".search-wrap button").hide();
  57. $(".search-wrap .search-close").show();
  58. }
  59. })
  60. // 移动端导航
  61. $(".nav-icon").click(function(){
  62. if($(".nav-list").css("display") == "none"){
  63. $(".nav-list").slideDown(200);
  64. }else{
  65. $(".nav-list").slideUp(200);
  66. }
  67. })
  68. }
  69. window.onresize = function () {
  70. var imgHeight = $(".swiper-container").height();
  71. $(".banner").height(imgHeight);
  72. }
  73. </script>