代码片段(1)[全屏查看所有代码]
1. [代码][JavaScript]代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
(
function
() {
$(
".proCitySelAll"
).click(
function
(event) {
if
($(
"body"
).data(
"CitysAll"
) ==
null
) {
sendAllCitiesAjax();
}
$(
this
).select();
$(
".provinceCity"
).hide();
$(
".provinceCityAll"
).hide();
$(
"#dimCityQuery"
).hide();
var
o2 = $(
this
).offset();
var
l2 = o2.left;
var
t2 = o2.top;
var
h2 = $(
this
).height();
$(
".provinceCityAll"
).css(
"top"
, t2 + h2 - 1).css(
"left"
, l2).toggle();
$(
".provinceCityAll"
).click(
function
(event) {
event.stopPropagation();
});
event.stopPropagation();
$(
"html"
).click(
function
() {
$(
".provinceCityAll"
).hide();
});
$(
"input.proCitySelAll"
).removeClass(
"current2"
);
$(
this
).addClass(
"current2"
);
$(
".provinceCityAll"
).find(
".tabs"
).find(
"a"
).removeClass(
"current"
);
$(
".provinceCityAll"
).find(
".tabs"
).find(
"a[tb=hotCityAll]"
).addClass(
"current"
);
$(
".provinceCityAll"
).find(
".con"
).children().hide();
$(
".provinceCityAll"
).find(
".con"
).find(
".hotCityAll"
).show();
if
($(
"body"
).data(
"allProvinces"
) ==
null
) {
sendAllProvinceAjax();
}
if
($(
"body"
).data(
"allCountys"
) ==
null
) {
sendAllCountiesAjax();
}
$(
".provinceCityAll"
).find(
".tabs"
).find(
"a"
).click(
function
() {
if
($(
this
).attr(
"tb"
) ==
"cityAll"
&& $(
".provinceAll .list .current"
).val() ==
null
) {
return
;
};
if
($(
this
).attr(
"tb"
) ==
"countyAll"
&& $(
".cityAll .list .current"
).val() ==
null
&& $(
".hotCityAll .list .current"
).val() ==
null
) {
return
;
};
$(
".provinceCityAll"
).find(
".tabs"
).find(
"a"
).removeClass(
"current"
);
$(
this
).addClass(
"current"
);
var
tb = $(
this
).attr(
"tb"
);
$(
".provinceCityAll"
).find(
".con"
).children().hide();
$(
".provinceCityAll"
).find(
".con"
).find(
"."
+ tb).show();
});
});
})();
|