lptuku.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. $(function(){
  2. // 楼盘相冊锚点
  3. function anchor(id){
  4. $(id).on('click',function(){
  5. $(this).addClass('on').siblings().removeClass('on')
  6. var m_id = $(this).attr("data-anc");
  7. var m_wz = $('.'+ m_id);
  8. var offsetj = Math.ceil(m_wz.offset().top);
  9. $('html,body').animate({scrollTop:offsetj},800);
  10. });
  11. }
  12. anchor('.y_tuku_nav ul li');//楼盘相冊锚点
  13. // 相册加载
  14. $('.y_tuku_ul').each(function(){
  15. if ($(this).find('li').length >=3) {
  16. $(this).find('.y_lptk_show').show();
  17. $(this).find('.y_lptk_show a').click(function(){
  18. $(this).parent().hide();
  19. $(this).parent().siblings('.y_lptk_none').show();
  20. if ($(this).attr('data-list') !='') {
  21. var echodataUl=$(this).parent().siblings('ul.y_tuku_ul_tu');
  22. $(this).parent().siblings('ul.y_tuku_ul_tu').css({'height':'auto','overflow':'hidden'});
  23. $(this).attr('data-list','')
  24. var post_id = $(this).attr('data-id');
  25. var post_hid = $(this).attr('data-hid');
  26. $.post('/housech/albumlist',{album_id:post_id,hid:post_hid,csrf_token_f:csrfToken},function (data) {
  27. echodataUl.html('');
  28. var data=data.data;
  29. // console.log(data);
  30. $.each(data,function(key,val){
  31. var html ='<li>';
  32. html+='<a class="elem" href="'+val.img+'">';
  33. html+='<p class="y_img"><img src="'+val.img+'" alt=""></p>';
  34. if (val.title == 'null') {
  35. html+='<p class="y_title"></p>';
  36. }else{
  37. html+='<p class="y_title">'+val.title+'</p>';
  38. }
  39. html+='</a>';
  40. html+='</li>';
  41. echodataUl.append(html);
  42. })
  43. })
  44. // yee.post('/housech/albumlist',{album_id:post_id,hid:post_hid,csrf_token_f:csrfToken},function(data){
  45. // echodataUl.html('');
  46. // var data=data.data;
  47. // // console.log(data);
  48. // $.each(data,function(key,val){
  49. // var html ='<li>';
  50. // html+='<a class="elem" href="'+val.img+'">';
  51. // html+='<p class="y_img"><img src="'+val.img+'" alt=""></p>';
  52. // html+='<p class="y_title">'+val.title+'</p>';
  53. // html+='</a>';
  54. // html+='</li>';
  55. // echodataUl.append(html);
  56. // })
  57. // },function(data){
  58. //
  59. // })
  60. }else{
  61. $(this).parent().siblings('ul.y_tuku_ul_tu').css({'height':'auto','overflow':'hidden'});
  62. };
  63. });
  64. $(this).find('.y_lptk_none a').click(function(){
  65. $(this).parent().hide();
  66. $(this).parent().siblings('.y_lptk_show').show();
  67. $(this).parent().siblings('ul.y_tuku_ul_tu').css({'height':'310px','overflow':'hidden'});
  68. })
  69. };
  70. });
  71. $("#y_tuku_nav1").scrollFix({
  72. distanceTop:$(".y_tuku_nav").outerHeight()-195,
  73. endPos: '.y_bottom_h',
  74. zIndex: 10
  75. })
  76. });
  77. $(document).ready(function(e) {
  78. lc_lightbox('.elem', {
  79. wrap_class: 'lcl_fade_oc',
  80. thumb_attr: 'data-lcl-thumb',
  81. skin: 'minimal',
  82. radius: 0,
  83. padding : 0,
  84. border_w: 0,
  85. });
  86. });