index.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. $(function () {
  2. //轮播图
  3. let swiper = new Swiper('#swiper1', {
  4. pagination: {
  5. el: '.swiper-pagination',
  6. },
  7. loop: true, //循环
  8. observer: true, //修改swiper自己或子元素时,自动初始化swiper
  9. observeParents: true, //修改swiper的父元素时,自动初始化swiper
  10. speed: 500,
  11. autoplay: {
  12. disableOnInteraction: false, //触碰后自动轮播也不会停止
  13. delay: 3000,
  14. },
  15. })
  16. $('.index-page .take-out .take-out-body .img-box1 .img-info').hover(
  17. function () {
  18. $('.index-page .take-out .take-out-body .img-box1 .take-out-img').fadeToggle()
  19. $('.index-page .take-out .take-out-body .img-box1').addClass('whiteColor')
  20. $('.index-page .take-out .take-out-body .img-box1 .img-info p').addClass('whiteColor')
  21. },
  22. function () {
  23. $('.index-page .take-out .take-out-body .img-box1 .take-out-img').fadeToggle()
  24. $('.index-page .take-out .take-out-body .img-box1').removeClass('whiteColor')
  25. $('.index-page .take-out .take-out-body .img-box1 .img-info p').removeClass('whiteColor')
  26. }
  27. )
  28. $('.index-page .take-out .take-out-body .img-box2 .img-info').hover(
  29. function () {
  30. $('.index-page .take-out .take-out-body .img-box2 .take-out-img').fadeToggle()
  31. $('.index-page .take-out .take-out-body .img-box2').addClass('whiteColor')
  32. $('.index-page .take-out .take-out-body .img-box2 .img-info p').addClass('whiteColor')
  33. },
  34. function () {
  35. $('.index-page .take-out .take-out-body .img-box2 .take-out-img').fadeToggle()
  36. $('.index-page .take-out .take-out-body .img-box2').removeClass('whiteColor')
  37. $('.index-page .take-out .take-out-body .img-box2 .img-info p').removeClass('whiteColor')
  38. }
  39. )
  40. $('.index-page .take-out .take-out-body .img-box3 .img-info').hover(
  41. function () {
  42. $('.index-page .take-out .take-out-body .img-box3 .take-out-img').fadeToggle()
  43. $('.index-page .take-out .take-out-body .img-box3').addClass('whiteColor')
  44. $('.index-page .take-out .take-out-body .img-box3 .img-info p').addClass('whiteColor')
  45. },
  46. function () {
  47. $('.index-page .take-out .take-out-body .img-box3 .take-out-img').fadeToggle()
  48. $('.index-page .take-out .take-out-body .img-box3').removeClass('whiteColor')
  49. $('.index-page .take-out .take-out-body .img-box3 .img-info p').removeClass('whiteColor')
  50. }
  51. )
  52. $('.index-page .map .select .select-btn').click(function () {
  53. $('.index-page .map .select .pull-box').fadeToggle()
  54. })
  55. })