123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- $(function(){
- var page = 1,limit=1;
- var oid =$('.chapter p em').attr('data-id');
- // 下一篇
- $('.chapter p em').on('click',function(){
- page++;
- fnAjax();
- })
- // 下一篇请求方法
- function fnAjax(){
- $.ajax({
- type: "post",
- url: "/news/next",
- data:{id:oid,page:page,limit:limit},
- dataType: "json",
- success: function(data){
- if(data.code == 200){
- // console.log(data.data)
- $('.chapter p.l span').html('<a href="/news/details/'+data.data.left_id+'">'+data.data.left+'</a>')
- $('.chapter p.r span').html('<a href="/news/details/'+data.data.id+'">'+data.data.subject+'</a>')
- }
- }
- });
- }
- fnAjax();
- // 换一换
- $('.lp_push em').on('click',function(){
- $.ajax({
- type: "post",
- url: "/news/morehouse",
- dataType: "json",
- success: function(data){
- if(data.code == 200){
- // console.log(data.data)
- var data=data.data;
- var _li ='';
- $.each(data,function(k,v){
- _li +='<li>';
- _li +='<a href="/house/jinbian-'+v.id+'/">'
- _li +='<div class="push_img"><img src="'+v.thumb+'" alt=""></div>';
- _li +='<div class="push_font">';
- _li +='<p>'+v.name+'</p>';
- _li +='<p>'+v.main_city+' - '+v.city_name+'</p>';
- _li +='<p>'+v.price+'<i>'+v.price_nuit+'</i></p>';
- _li +='<p><em>'+v.main_units+'</em></p>';
- _li +='</div>';
- _li +='</a>';
- _li +='</li>';
- })
- $('.push_box ul').html("");
- $('.push_box ul').append(_li);
- }
- }
- });
- })
- })
- /*调用的方法*/
- PublicAction.AjaxSend(
- {
- CORID:'apply_su', /*操作ID*/
- }
- );
- /*调用的方法*/
- PublicAction.AjaxSend(
- {
- CORID:'apply_s', /*操作ID*/
- }
- );
- $(function(){
- $('.details_cont').find('img').each(function(){
- var $that = $(this);
- $that.removeAttr('width');
- $that.removeAttr('height');
- if($that.attr('alt') != 'alt'){
- $that.css({'width':'100%','height':'auto'});
- }
-
- })
- var swiper = new Swiper('.newsSlide_box', {
- loop : true,
- autoplay : 5000,
- pagination: '.newsSlide .swiper-pagination',
- paginationClickable: true,
- paginationBulletRender: function (swiper, index, className) {
- return '<span class="' + className + '">' + (index + 1) + '</span>';
- }
- });
- var swiper = new Swiper('.hotwenda_main', {
- loop : true,
- autoplay : 5000,
- slidesPerView:1,
- autoHeight: true, //高度随内容变化
- });
- })
-
|