$(function(){ // 限时特惠滚动js var obj=$('.ztHead_intr'); var dw=obj.find(".lpjs").width(); var cw=obj.find(".lpjs span").width(); var cx=0; //宽度超出当前content宽度才滚动 if(cw>dw){ var scrollval=null;//滚动事件变量 obj.find(".lpjs span").append(obj.find(".lpjs i").eq(0).html()); function move(){ obj.find(".lpjs span").css({ "left":"-"+cx+"px" }) if(cx>(cw-dw)+dw) cx=0; cx++; } scrollval = setInterval(move,35); obj.mouseover(function(){ clearInterval(scrollval); }); obj.mouseout(function(){ scrollval = setInterval(move,35); }) } // 调取数据ajax var cityId="" var cityName="" cityId=$('.susp_main ul li').eq(0).attr('data-id'); $('.susp_main ul li').eq(0).addClass('on'); cityName=$('.susp_main ul li').eq(0).find('a').text(); $('.main_title span').html(cityName+'热卖房产TOP榜'); chunjiezt(); $('.value_pulic[data-id="'+cityId+'"]').show(); $('.susp_main ul li').on('click',function(){ $(this).addClass('on').siblings().removeClass('on'); cityId=$(this).attr('data-id'); cityName=$(this).find('a').text(); $('.main_title span').html(cityName+'热卖房产TOP榜') $('.cityValue_m p.title_text').html('带你读懂'+cityName+'置业优势'); $('body input[name="intention_city"]').val(cityName); chunjiezt(); $('.value_pulic').hide(); $('.value_pulic[data-id="'+cityId+'"]').show(); }) function chunjiezt(){ $('.lplist_mainbox').html('') // $('.value_pulic').html('') var _html=""; var _value=''; $.ajax({ type:'POST', url:'/zt/chunjieztform', data:{id:cityId}, async:false, dataType:'json', success:function(data){ if(data.code == 200){ var _data=data.data; _html+='
'; _html+=''; _html+='
'; // $.each(_data,function (key,val) { // var _key=key+1 // _value+='
'; // if ( _key%2 ==0) { // _value+='
'; // }else{ // _value+='
'; // } // _value+='

'; // _value+=''; // _value+='
'; // if ( _key%2 ==0) { // _value+='
'; // }else{ // _value+='
'; // } // _value+='

'+_key+'. 宜居环境

'; // _value+='

海南四季温暖且森林覆盖率高,负氧离子充足。海南以优美的热带滨海风光为主要特色,是国内居住旅游的优选之地。

'; // _value+='
'; // _value+='
'; // if ( _key%2 ==0) { // _value+='
'; // }else{ // _value+='
'; // } // }) $('.lplist_mainbox').html(_html); // $('.value_pulic').html(_value); // 轮播图 var mySwiper1 = new Swiper('.lplist_main',{ autoplay:false, //自动切换 loop : true, //循环 pagination: '.swiper-pagination', // 如果需要分页器 onSlideChangeEnd: function(swiper){ var lphid=$('.lplist_main .swiper-slide-duplicate-active').attr('data-hid'); $('.lpfoot_but a.in_but').attr('data-hid',lphid); }, }) } } }) } // 豪礼报名js $("body").on('click','.luxury_buttom',function(){ var bmhid=$(this).attr('data-hid'); var bmsource=$(this).attr('data-source'); $('.luxuryMain form input[name="hid"]').val(bmhid) $('.luxuryMain form input[name="source"]').val(bmsource) $('.luxuryBox').show(30); $('.luxuryBg').show(); }) $('.luxuryBg,.ico_bg').on('click',function(){ $('.luxuryBox').hide(); $('.luxuryBg').hide(); $('body input[type="text"]').val(''); }) // 豪礼报名js $("body").on('click','.purchase_buttom',function(){ $('.purchaseBox').show(30); $('.purchaseBg').show(); }) $('.purchaseBg,.pu_gb').on('click',function(){ $('.purchaseBox').hide(); $('.purchaseBg').hide(); $('body input[type="text"]').val(''); }) // 右边悬挂 $(window).scroll(function (){ var st = $(this).scrollTop(); // console.log(st); if(st >170){ $('.suspBox').show(); }else{ $('.suspBox').hide(); } }); $('.Pgup').on('click',function(){ $('html,body').animate({scrollTop: '0px'}, 500); }) // 报名提交事件 PublicAction.AjaxSend( { CORID:'buttom_tj', /*操作ID*/ } ); $('.submit_area .buttom_tj').on('click',function(){ setTimeout(function(){ var _html = $('.alert-container .alert-content').html(); if(_html == '提交成功'){ $('.purchaseBox').hide(); $('.purchaseBg').hide(); $('.luxuryBox').hide(); $('.luxuryBg').hide(); $('body input[type="text"]').val(''); } },300) }) })