123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- $(function(){
- // 热推看房团
- new Swiper('.hot-box',{
- slidesPerView :'auto',
- spaceBetween : 20,
- prevButton:'.hotprev',
- nextButton:'.hotnext',
- })
- var oid = false;
- var aClass = $('.widget-box');
- // 关闭按钮
- $('.widget-cls').on('click',function(){
- aClass.removeClass('adi');
- oid = aClass.hasClass('adi');
- aClass.animate({width:'8px',height:'8px',right:'100px',bottom:'325px'},function(){
- var _this = $(this);
- _this.animate({bottom:'280px'},function(){
- _this.hide();
- })
- })
- })
- // 点击按钮弹出报名窗口
- $('.alive').on('click',function(){
- if(!oid){
- aClass.show();
- aClass.animate({width:'8px',height:'8px',right:'100px',bottom:'325px'},function(){
- var _this = $(this);
- _this.animate({width:'240px',height:'312px',right:'20px',bottom:'350px'})
- })
- }
- aClass.addClass('adi');
- oid = aClass.hasClass('adi')
- })
- /*-------------------- 获取地址栏地址并拆分 --------------------------------*/
- function getParams(url) {
- var theRequest = new Object();
- if (!url)
- url = location.href;
- if (url.indexOf("?") !== -1)
- {
- var str = url.substr(url.indexOf("?") + 1) + "&";
- var strs = str.split("&");
- for (var i = 0; i < strs.length - 1; i++)
- {
- var key = strs[i].substring(0, strs[i].indexOf("="));
- var val = strs[i].substring(strs[i].indexOf("=") + 1);
- theRequest[key] = val;
- }
- }
- return theRequest;
- }
- var objUrl = {}; //获取get参数
- var url = window.location.href;
-
- var params = getParams(url);
- if(!$.isEmptyObject(params)){
- $.each(params,function(key,val){
- objUrl[key] = val;
- })
- }
- // 类目导航
- $('.top-nav-li ul li').on('click',function(){
- var that = $(this);
- var oid = that.attr('data-oid');
- that.addClass('on').siblings('li').removeClass('on');
- objUrl['type'] = oid;
- skipUrl(objUrl);
- })
- // 国家导航
- $('.genera-center-nav ul li').on('click',function(){
- var that = $(this);
- var cid = that.attr('data-city');
- that.addClass('on').siblings('li').removeClass('on');
- objUrl['cid'] = cid;
- skipUrl(objUrl);
- })
- function skipUrl(data){
- // console.log(data)
- var urlParams ="";
- $.each(data,function(key,val){
- urlParams += key+'='+val+'&';
- })
- var cityUrl = '';
- urlParams = urlParams.substring(0,urlParams.length - 1);
- if(urlParams == '' && cityUrl != ''){
- cityUrl = cityUrl.substring(0,cityUrl.length - 1);
- }
- // console.log(cityUrl)
- // console.log(urlParams)
- window.location.href = '/news/knowledge?'+urlParams;
- }
- /*
- * 调用的方法
- * */
- PublicAction.AjaxSend(
- {
- CORID:'apply_submit', /*操作ID*/
- }
- );
- // 问答字数限制
- $('.faqs-box ul li').each(function(){
- var _that=$(this);
- var _txtm=_that.find('.fa span em').text();
- var _txtlength= _that.find('.fa span em').text().length;
- if (_txtlength > 115) {
- _that.find('.fa span em').text(_txtm.substring(0,num)+"...");
- }
- console.log(_txt);
- })
- jQuery.fn.limit=function(){
- var self = $("[limit]");
- self.each(function(){
- var objString = $(this).text();
- var objLength = $(this).text().length;
- var num = $(this).attr("limit");
- if(objLength > num){
- $(this).attr("title",objString);
- objString = $(this).text(objString.substring(0,num)+"...");
- }
- $(this).attr("title"," ")
- })
- }
- // $(function(){
- // $(".list li a").attr("limit",18)
- // $("#last_show p").attr("limit",35)
- // $(".newsList li a").attr("limit",24)
- // $("[limit]").limit();
- // })
- })
|