js 获取星座
2010-06-01 15:16
190 查看
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 "";
}
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 "";
}
相关文章推荐
- 获取星座的JS函数
- JS获取当前时间
- js里获取PHP数组并使用
- js获取客户时间倒计时,js获取服务器端时间倒计时
- 获取短信验证码的js倒计时
- js 添加、获取、删除 cookie
- JS获取光标位置
- js获取汉字拼音
- [完美]原生JS获取浏览器版本判断--支持Edge,IE,Chrome,Firefox,Opera,Safari,以及各种使用Chrome和IE混合内核的浏览器
- 根据日期获取生肖,根据日期获取星座
- JS获取屏幕,浏览器,网页高度宽度
- js获取frameSet子页面的空间
- js获取height为auto的高度问题
- ip查询js获取页面属性
- JS获取DropDownList选择项的值
- js获取select选中的值
- js获取除自身外的所有兄弟节点
- servlet中获取js传过来的数组
- js获取文件上传路径(解决出现fakepath的问题)
- JS获取当前时间戳的方法