js 代码
复制代码 代码如下:
function birthdayOnchange(obj) {
var year = $("<%= DDL_Year.ClientID%>").value;
if (year == "year")
return;
else
year = parseInt(year, 10);
var month = $("<%=DDL_Month.ClientID%>").value;
if (month == "month")
return;
else
month = parseInt(month, 10);
var day = $("<%=DDL_Day.ClientID%>").value;
var wholeday = getDays(year, month);
if (1) {
var options = $("<%=DDL_Day.ClientID%>").options;
for (var i = 1; i <= wholeday; i++) {
var j = i.toString();
j = j.length == 1 ? "0" + j : j;
options.length = i + 1;
options[i].value = j;
options[i].text = j;
if (day <= wholeday && i == day) {
options[i].selected = true;
}
}
}
}
function getDays(year, month) {
var dayarr = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if (month == 2) {
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0 || year < 1900)
return 29;
else
return dayarr[month - 1];
}
else {
return dayarr[month - 1];
}
}
function adjustAstro() {
var v_astro = getAstro($("<%=DDL_Month.ClientID%>").value, $("<%=DDL_Day.ClientID%>").value);
$("<%=astro.ClientID %>").options[0].text = v_astro;
}
function getAstro(v_month, v_day) {
v_month = parseInt(v_month, 10)
v_day = parseInt(v_day, 10);
if ((v_month == 12 && v_day >= 22)
|| (v_month == 1 && v_day <= 20)) {
return "魔羯座";
}
else if ((v_month == 1 && v_day >= 21)
|| (v_month == 2 && v_day <= 19)) {
return "水瓶座";
}
else if ((v_month == 2 && v_day >= 20)
|| (v_month == 3 && v_day <= 20)) {
return "双鱼座";
}
else if ((v_month == 3 && v_day >= 21)
|| (v_month == 4 && v_day <= 20)) {
return "白羊座";
}
else if ((v_month == 4 && v_day >= 21)
|| (v_month == 5 && v_day <= 21)) {
return "金牛座";
}
else if ((v_month == 5 && v_day >= 22)
|| (v_month == 6 && v_day <= 21)) {
return "双子座";
}
else if ((v_month == 6 && v_day >= 22)
|| (v_month == 7 && v_day <= 22)) {
return "巨蟹座";
}
else if ((v_month == 7 && v_day >= 23)
|| (v_month == 8 && v_day <= 23)) {
return "狮子座";
}
else if ((v_month == 8 && v_day >= 24)
|| (v_month == 9 && v_day <= 23)) {
return "处女座";
}
else if ((v_month == 9 && v_day >= 24)
|| (v_month == 10 && v_day <= 23)) {
return "天秤座";
}
else if ((v_month == 10 && v_day >= 24)
|| (v_month == 11 && v_day <= 22)) {
return "天蝎座";
}
else if ((v_month == 11 && v_day >= 23)
|| (v_month == 12 && v_day <= 21)) {
return "射手座";
}
return "";
}
html
复制代码 代码如下:
<DIV>出生日期:</DIV>
<DIV>
<asp:DropDownList ID="DDL_Year" runat="server" onchange="birthdayOnchange(this);"></asp:DropDownList> 年
<asp:DropDownList ID="DDL_Month" runat="server" onchange="birthdayOnchange(this);adjustAstro();"></asp:DropDownList> 月
<asp:DropDownList ID="DDL_Day" runat="server" onchange="adjustAstro();"></asp:DropDownList> 日
</DIV>
<DIV>星座:</DIV>
<DIV>
<SELECT id=astro disabled name=astro runat="server">
<OPTION selected>处女座</OPTION>
</SELECT>
</DIV>
js级联
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 纪钧瀚《钢琴阅读时光 雨中书店聆听轻音乐》[FLAC/分轨][399.62MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[320K/MP3][87.4MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[FLAC/分轨][184.94MB]
- 陈慧娴.2018-Priscilla-Ism演唱会3CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 郑秀文.1999-我应该得到(国)【华纳】【WAV+CUE】
- 陈家慧.2011-钢琴酒吧2CD【龙吟唱片】【WAV+CUE】
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[320K/MP3][45.01MB]
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[FLAC/分轨][109.13MB]
- 赞多《序章》[320K/MP3][45.54MB]
- 许巍.2004-每一刻都是崭新的【步升大风】【WAV+CUE】
- 群星.2024-四方馆影视原声带【韶愔音乐】【FLAC分轨】
- 陈雷.1997-安锁咧【金圆唱片】【WAV+CUE】
- 关淑怡.2013-MY.FAVORITE.SK.3CD【环球】【WAV+CUE】
- Sweety.2006-花言乔语【丰华】【WAV+CUE】
- 李恕权.2003-回·20年全精选2CD【SONY】【WAV+CUE】