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.
64 lines
1.9 KiB
JavaScript
64 lines
1.9 KiB
JavaScript
//各个函数区
|
|
//Obj 单击对像,calback回调函数
|
|
function TrunMenu2(Obj,callback){
|
|
$(Obj).siblings("li").removeClass("active").end().addClass("active");
|
|
var cmid = $(Obj).attr("mid");
|
|
var data = $(Obj).attr("data").split("|");
|
|
if($("#"+cmid).size()<1){
|
|
$("#waitingtable").siblings("table:visible,div:visible").hide().end().show();
|
|
$.ajax({
|
|
url:'/api/api.asp?method=cht.flight.deals&C1='+data[0]+'&id='+cmid+'&city='+data[1],
|
|
success:function(data){
|
|
$("#waitingtable").hide();
|
|
$("#CheapChinaFlights").append(data);
|
|
$("#"+cmid).siblings("table:visible,div:visible").hide().end().show();
|
|
if(typeof callback =="function"){
|
|
callback(Obj);
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
$("#"+cmid).siblings("table:visible,div:visible").hide().end().show();
|
|
if(typeof callback =="function"){
|
|
callback(Obj);
|
|
}
|
|
}
|
|
}
|
|
function cb(obj){
|
|
$(obj).append($("#MenuBottomArr"));
|
|
}
|
|
|
|
$(function(){
|
|
//日历
|
|
var sdates = $("#takeoffDate1")
|
|
.datepicker({showAnim:"fadeIn",duration:0,minDate: 0, maxDate:"1y",numberOfMonths: 2,showButtonPanel: true}).bind('dateSelected',
|
|
function(e, selectedDate, td){
|
|
if($(":radio[checked]").val() == '2'){
|
|
$("#takeoffDate2").datepicker('option', 'minDate', new Date(selectedDate)).focus();
|
|
}
|
|
}
|
|
);
|
|
var sdates2= $("#takeoffDate2")
|
|
.datepicker({showAnim:"fadeIn",duration:0,minDate: 0, maxDate:"1y",numberOfMonths: 2,showButtonPanel: true});
|
|
|
|
//往返选择
|
|
$("input[name=triptype]").click(function(){
|
|
switch($(this).val()){
|
|
case "1": //单程
|
|
$(this).parents("form").find("#endDate").hide();
|
|
break;
|
|
case "2": //往返
|
|
$(this).parents("form").find("#endDate").show();
|
|
break;
|
|
}
|
|
});
|
|
|
|
$.ajax({
|
|
url:'/api/api.asp?method=cht.flight.deals&C1=pek&id=chtCheep_Beijing&city=beijing',
|
|
success:function(data){
|
|
$("#waitingtable").hide();
|
|
$("#CheapChinaFlights").append(data);
|
|
}
|
|
});
|
|
});
|