<script language= "JavaScript" > |
|
|
|
$ (document). Ready (function () { |
|
Purchase |
|
$ ("#orderButton"). Click (function () { |
|
var departure_city_id = $ (' #departure_city_id '). Val (); |
|
var adult_num = $ (' #adult '). Val (); |
|
var child_num = $ (' #child '). Val (); |
|
var departure_date = $ ("#departure_date"). Val (); |
|
var tid = $ ("#tid"). Val (); |
|
if (!departure_city_id) { |
|
Alert (' Please select Departure city '); |
|
return false; |
|
} |
|
|
|
if (!departure_date) { |
|
Alert (' Please select a departure date from the Calendar '); |
|
return false; |
|
} |
|
if (!adult_num) { |
|
Alert (' Please select the number of adult passengers '); |
|
return false; |
|
} |
|
$ (this). Val (' In Process ... '); |
|
$.post ("/product/purchase", {id:departure_city_id, Adult_num:adult_num, Child_num:child_num, Departure_date: Departure_date, Tid:tid}, function (Result) { |
|
if (Result.status = = "OK") { |
|
window.location.href = '/cart ' |
|
} else { |
|
alert (result.msg); |
|
$ ("#orderButton"). Val (' book Now '); |
|
return false; |
|
} |
|
}, "JSON"); |
|
}); |
|
Huanli (". Cy_kuang2 ul", "Li"); |
|
$ (". Cy_kuang2 ul li"). Click ( |
|
function () { |
|
var css_this = "This" |
|
var Data_url = $ (this). attr ("Data-url"); |
|
$ (this). addclass (Css_this). Siblings (). Removeclass (Css_this); |
|
$ ("Html,body"). Animate ({scrolltop: $ (data_url). Offset (). top-40}); |
|
}); |
|
$ (". Sidebar. Daybox"). Click ( |
|
function () { |
|
var css_this = "This" |
|
var Data_url = $ (this). attr ("Data-url"); |
|
$ (this). addclass (Css_this). Siblings (). Removeclass (Css_this); |
|
$ ("Html,body"). Animate ({scrolltop: $ (data_url). Offset (). top-40}); |
|
}); |
|
Wake-up return to head button |
|
var NT =! 1, NT1 =! 1; |
|
$ (window). Bind ("scroll", |
|
function () { |
|
var st = $ (document). ScrollTop (); The height of the roll down |
|
NT = NT? NT: $ (". Cy_kuang3"). Offset (). Top; |
|
Nt1 = Nt1? NT1: $ (". Tripall"). Offset (). Top; |
|
document.title=st; |
|
var sel = $ (". Cy_kuang2"), CSS = "Fudongx", Sel1 = $ (". Sidebar"), Css1 = "FUDONGXA"; |
|
if (NT <= St) { |
|
Sel.addclass (CSS); |
|
} |
|
if (NT > St) { |
|
Sel.removeclass (CSS); |
|
} |
|
; |
|
if (nt1 <= St) { |
|
Sel1.addclass (CSS1); |
|
} |
|
if (Nt1 > St) { |
|
Sel1.removeclass (CSS1); |
|
} |
|
; |
|
if ($ (". Tripall_end"). Offset (). Top-$ (". Sidebar"). Height () < st) { |
|
Sel1.removeclass (CSS1); |
|
} |
|
for (var i = 0; i < 4; i++) { |
|
var III = i + 1; |
|
if (St > $ (". Ck_" + III). Offset (). top-100) { |
|
$ (". Cy_kuang2"). Find ("Li:eq (" + i + ")"). AddClass ("This"). Siblings (). Removeclass ("this"); |
|
} |
|
} |
|
; |
|
var day_num = $ (". Tripdays"). Size (); |
|
for (var i = 0; i < Day_num; i++) { |
|
var III = i + 1; |
|
if (St > $ (". Day" + III). Offset (). top-100) { |
|
$ (". Sidebar"). Find (". Daybox:eq (" + i + ")"). AddClass ("This"). Siblings (). Removeclass ("this"); |
|
} |
|
} |
|
; |
|
}); |
|
}); |
|
Get average divide |
|
Huanli = function (Wai, nei) { |
|
var wai = $ (wai) |
|
Wai.show (). Parent (). Show (); |
|
var li = wai.find (nei), V = li.size (), VV = Wai.width ()/V; |
|
Li.width (VV); |
|
}; </script> |