You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.8 KiB
JavaScript
68 lines
1.8 KiB
JavaScript
6 years ago
|
$(document).ready(function(e) {
|
||
|
|
||
|
//判断设备
|
||
|
if(/AppleWebKit.*Mobile/i.test(navigator.userAgent)|| /Android/i.test(navigator.userAgent) || /Mobile/i.test(navigator.userAgent)){
|
||
|
$('.flexslider').flexslider({
|
||
|
animation: "slide"
|
||
|
//pauseOnAction默认为true 当用户点击上/下一张图片时停止播放动画
|
||
|
//pauseOnAction:false
|
||
|
});
|
||
|
}else{
|
||
|
$('.flexslider').flexslider({
|
||
|
animation: "fade"
|
||
|
});
|
||
|
}
|
||
|
//判断设备end
|
||
|
//alert(navigator.userAgent);
|
||
|
sid='4419,2024,1832,1866';
|
||
|
getTafbindex2(sid);
|
||
|
});
|
||
|
function getTafbindex2(id){
|
||
|
if(typeof(id)=='undefined' || id==''){
|
||
|
return;
|
||
|
}
|
||
|
$.ajax({
|
||
|
url:'/api/api.php?method=tahomepage',
|
||
|
data:{'id':id},
|
||
|
type:'POST',
|
||
|
success: function(str){
|
||
|
//console.log(str);
|
||
|
if(str==''){
|
||
|
return;
|
||
|
}
|
||
|
var json=eval('('+str+')');
|
||
|
idArr=id.split(",");
|
||
|
for(i=0;i<idArr.length;i++)
|
||
|
{
|
||
|
var tmp='';
|
||
|
tmp+='<span class="ratingIcon">';
|
||
|
tmp+=json['ta'+idArr[i]].pic;
|
||
|
tmp+='</span>';
|
||
|
tmp+='<span class="reviewNo">';
|
||
|
tmp+=json['ta'+idArr[i]].review;
|
||
|
tmp+=' reviews </span>';
|
||
|
$('.s'+idArr[i]).append(tmp);
|
||
|
//console.log(tmp);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
(function() {
|
||
|
var _ref = document.referrer;
|
||
|
var q = getParameterByName("q", _ref);
|
||
|
if ( q.length > 0 ) {
|
||
|
var _keyworkds = getParameterByName("q", _ref);
|
||
|
var _date = new Date();
|
||
|
_date.setDate(_date.getDate()+30);
|
||
|
var exp = _date.toGMTString();
|
||
|
document.cookie='inquireTrackAG='+_keyworkds.replace(/(\s+)/g, '_')+';path=/;expires='+exp;
|
||
|
}
|
||
|
})();
|
||
|
|
||
|
function getParameterByName(name, url) {
|
||
|
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
||
|
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
||
|
results = regex.exec(url);
|
||
|
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
||
|
}
|