一个兼容IE、Firefox和Opera浏览器的英文日历脚…
2008-02-23 07:50:03来源:互联网 阅读 ()
sTmp = sTmp.replace ("mmmm","<p>")
sTmp = sTmp.replace ("mmm","<o>")
sTmp = sTmp.replace ("mm","<n>")
sTmp = sTmp.replace ("m","<m>")
sTmp = sTmp.replace ("<m>",m 1)
sTmp = sTmp.replace ("<n>",padZero(m 1))
sTmp = sTmp.replace ("<o>",monthName[m])
sTmp = sTmp.replace ("<p>",monthName2[m])
sTmp = sTmp.replace ("yyyy",y)
return sTmp.replace ("yy",padZero(y0))
}
function closeCalendar()
{
var sTmp
hideCalendar();
ctlToPlaceValue.value = constructDate(dateSelected,monthSelected,yearSelected)
}
/*** Month Pulldown ***/
function StartDecMonth()
{
intervalID1=setInterval("decMonth()",80)
}
function StartIncMonth()
{
intervalID1=setInterval("incMonth()",80)
}
function incMonth ()
{
monthSelected
if (monthSelected>11)
{
monthSelected=0
yearSelected
}
constructCalendar()
}
function decMonth ()
{
monthSelected--
if (monthSelected<0)
{
monthSelected=11
yearSelected--
}
constructCalendar()
}
function upMonth()
{
if(nStartingMonth > 0)
{
nStartingMonth --;
for (i=0; i<6; i )
{
newMonth = (i nStartingMonth);
if (newMonth == monthSelected)
txtMonth = " <B>" monthName[newMonth] "</B> ";
else
txtMonth = " " monthName[newMonth] " ";
document.getElementById("m" i).innerHTML = txtMonth;
}
}
bShow=true
}
function downMonth()
{
if(nStartingMonth < 6)
{
nStartingMonth ;
for (i=0; i<6; i )
{
newMonth = (i nStartingMonth);
if (newMonth == monthSelected)
txtMonth = " <B>" monthName[newMonth] "</B> ";
else
txtMonth = " " monthName[newMonth] " ";
document.getElementById("m" i).innerHTML = txtMonth;
}
}
bShow=true
}
function selectMonth(nMonth)
{
monthSelected=parseInt(nMonth nStartingMonth);
monthConstructed=false;
constructCalendar();
popDownMonth();
}
function constructMonth()
{
popDownYear()
if (!monthConstructed)
{
sHTML = "<tr><td align='center' onmouseover='this.style.backgroundColor=\"#FFCC99\"' onmouseout='clearInterval(intervalID1);this.style.backgroundColor=\"\"' style='cursor:pointer' onmousedown='clearInterval(intervalID1);intervalID1=setInterval(\"upMonth()\",30)' onmouseup='clearInterval(intervalID1)'>-</td></tr>"
j=0;
i=(monthSelected-3);
if(i < 0)
i=0;
if(i > 6)
i=6;
nStartingMonth = i;
for (ii=0; ii<6; ii , i , j )
{
sName = monthName[i];
if (i==monthSelected)
{
sName = "<B>" sName "</B>"
}
sHTML = "<tr><td id='m" j "' onmouseover='this.style.backgroundColor=\"#FFCC99\"' onmouseout='this.style.backgroundColor=\"\"' style='cursor:pointer' onclick='selectMonth(" j ");event.cancelBubble=true'> " sName " </td></tr>"
}
sHTML = "<tr><td align='center' onmouseover='this.style.backgroundColor=\"#FFCC99\"' onmouseout='clearInterval(intervalID2);this.style.backgroundColor=\"\"' style='cursor:pointer' onmousedown='clearInterval(intervalID2);intervalID2=setInterval(\"downMonth()\",30)' onmouseup='clearInterval(intervalID2)'> </td></tr>"
document.getElementById("selectMonth").innerHTML = "<table width=32 style='font-family:arial; font-size:11px; border-width:1; border-style:solid; border-color:#a0a0a0;' bgcolor='#FFFFDD' cellspacing=0 onmouseover='clearTimeout(timeoutID1)' onmouseout='clearTimeout(timeoutID1);timeoutID1=setTimeout(\"popDownMonth()\",100);event.cancelBubble=true'>" sHTML "</table>"
monthConstructed=true
}
}
function popUpMonth()
{
constructMonth()
crossMonthObj.visibility = (dom||ie)? "visible" : "show"
crossMonthObj.left = parseInt(crossobj.left) 50
crossMonthObj.top = parseInt(crossobj.top) 26
hideElement( 'SELECT', document.getElementById("selectMonth") );
hideElement( 'APPLET', document.getElementById("selectMonth") );
}
function popDownMonth()
{
crossMonthObj.visibility= "hidden"
}
/*** Year Pulldown ***/
function incYear()
{
for (i=0; i<6; i )
{
newYear = (i nStartingYear) 1
if (newYear==yearSelected)
{
txtYear = " <B>" newYear "</B> "
}
else
{
txtYear = " " newYear " "
}
document.getElementById("y" i).innerHTML = txtYear
}
nStartingYear ;
bShow=true
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash
