1003210180_run.jsp 2.6 KB

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