zizaicheng.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. var hx = "";
  2. hx +='<li class="swiper-slide"><a href="/house/housetype/6008/"><img src="/zt/zizaicheng20190305/image/hx1.jpg" alt=""></a></li>';
  3. hx +='<li class="swiper-slide"><a href="/house/housetype/6008/"><img src="/zt/zizaicheng20190305/image/hx2.jpg" alt=""></a><</li>';
  4. hx +='<li class="swiper-slide"><a href="/house/housetype/6008/"><img src="/zt/zizaicheng20190305/image/hx3.jpg" alt=""></a><</li>';
  5. hx +='<li class="swiper-slide"><a href="/house/housetype/6008/"><img src="/zt/zizaicheng20190305/image/hx4.jpg" alt=""></a><</li>';
  6. hx +='<li class="swiper-slide"><a href="/house/housetype/6008/"><img src="/zt/zizaicheng20190305/image/hx5.jpg" alt=""></a><</li>';
  7. hx +='<li class="swiper-slide"><a href="/house/housetype/6008/"><img src="/zt/zizaicheng20190305/image/hx6.jpg" alt=""></a><</li>';
  8. hx +='<li class="swiper-slide"><a href="/house/housetype/6008/"><img src="/zt/zizaicheng20190305/image/hx7.jpg" alt=""></a><</li>';
  9. var ybj = "";
  10. ybj +='<li class="swiper-slide"><a href="/house/album/6008/"><img src="/zt/zizaicheng20190305/image/ybj1.jpg" alt=""></a><</li>';
  11. ybj +='<li class="swiper-slide"><a href="/house/album/6008/"><img src="/zt/zizaicheng20190305/image/ybj2.jpg" alt=""></a><</li>';
  12. ybj +='<li class="swiper-slide"><a href="/house/album/6008/"><img src="/zt/zizaicheng20190305/image/ybj3.jpg" alt=""></a><</li>';
  13. ybj +='<li class="swiper-slide"><a href="/house/album/6008/"><img src="/zt/zizaicheng20190305/image/ybj4.jpg" alt=""></a><</li>';
  14. $('.Plan_xc_title p').on('click',function(){
  15. var dataid = $(this).attr('data-type');
  16. $(this).attr('class','on').siblings().attr('class','');
  17. switch(dataid)
  18. {
  19. case '2':
  20. $('.Plan_xclb_box').html('<div class="Plan_xclb swiper1"><ul class="swiper-wrapper">'+hx+'</ul><div class="swiper-button-prev" id="prev"></div><div class="swiper-button-next" id="next"></div><div class="swiper-pagination"></div></div>');
  21. break;
  22. case '3':
  23. $('.Plan_xclb_box').html('<div class="Plan_xclb swiper1"><ul class="swiper-wrapper">'+ybj+'</ul><div class="swiper-button-prev" id="prev"></div><div class="swiper-button-next" id="next"></div><div class="swiper-pagination"></div></div>');
  24. break;
  25. }
  26. var mySwiper3= new Swiper(".swiper1",{
  27. loop : false,
  28. loopedSlides:4,
  29. // pagination: '.swiper-pagination',
  30. autoplayDisableOnInteraction : false,
  31. slidesPerView :"auto",
  32. // 如果需要前进后退按钮
  33. nextButton: '.swiper-button-next',
  34. prevButton: '.swiper-button-prev',
  35. paginationType : 'fraction',
  36. pagination: '.swiper-pagination',
  37. paginationFractionRender: function (swiper, currentClassName, totalClassName) { //图片数量
  38. return '<span class="' + currentClassName + '"></span>' +
  39. ' / ' +
  40. '<span class="' + totalClassName + '"></span>';
  41. },
  42. });
  43. })
  44. $('.Plan_xc_title > p').eq(0).click(); //默认点击第一个