index.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. $(function(){
  2. function FnAjax(oid){
  3. $.ajax({
  4. url:"./index",
  5. type:"post",
  6. data:{id:oid},
  7. dataType:"json",
  8. success:function(data){
  9. if(data.code == 200){
  10. FnTraverse(data.data);
  11. }
  12. },
  13. error:function(request){
  14. console.log('加载失败!');
  15. }
  16. })
  17. }
  18. // 数据遍历
  19. function FnTraverse(data){
  20. var _html = '';
  21. $.each(data,function(k,v){
  22. _html += '<li>';
  23. _html += '<a href="javascript:void(0);">';
  24. _html += '<div class="ban_img"><img src="./image/icon_img.png" alt=""></div>';
  25. _html += '<div class="ban_font">';
  26. _html += '<p class="ban_title">Huaikwang丽晶公府<span>¥125万</span></p>';
  27. _html += '<p class="house_type">户型:29㎡1居、34㎡2居</p>';
  28. _html += '<p class="explain"><img src="./image/icon_map.png" alt="">曼谷西部舒适生活区,东靠湄南河,紧连沙吞涉外金融CBD</p>';
  29. _html += '</div>';
  30. _html += '</a>';
  31. _html += '</li>';
  32. })
  33. $('.ban_conter ul').html("");
  34. $('.ban_conter ul').append(_html);
  35. // 精选房源
  36. var swiper4 = new Swiper('#swiper4',{
  37. autoplay:true, //自动切换
  38. // loop : true, //循环
  39. slidesPerView :'auto',
  40. slidesPerGroup : 1,
  41. nextButton: '.next',
  42. prevButton: '.prev',
  43. pagination : '.ld',
  44. paginationType : 'fraction',
  45. });
  46. }
  47. // 精选房源
  48. var swiper4 = new Swiper('#swiper4',{
  49. autoplay:true, //自动切换
  50. // loop : true, //循环
  51. slidesPerView :'auto',
  52. slidesPerGroup : 1,
  53. nextButton: '.next',
  54. prevButton: '.prev',
  55. pagination : '.ld',
  56. paginationType : 'fraction',
  57. });
  58. })