Product Details page, banner scrolling click Loading effect, Js,jquary

Source: Internet
Author: User

<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>

Product Details page, banner scrolling click Loading effect, Js,jquary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.