Home >Web Front-end >JS Tutorial >Modify the js Calendar calendar control to be compatible with IE9/Google/Firefox_javascript skills

Modify the js Calendar calendar control to be compatible with IE9/Google/Firefox_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:44:281404browse

Modify the Calendar calendar control to be compatible with IE9, Google, and Firefox.
It just works, but the position is different. I hope someone can help me change it. Thank you
1.

Copy code The code is as follows:

this.iframe = window.frames("meizzCalendarIframe");

is modified to
Copy code The code is as follows:

this.iframe = window.frames["meizzCalendarIframe"];

2.
Copy code The code is as follows:

var a = (arguments.length= =0) ? WebCalendar.day[this.id.substr(8)].split("/") : arguments[0].split("/");

is changed to
Copy code The code is as follows:

var a = WebCalendar.day[this.id.substr(8 )].split("/");


3.
Copy code The code is as follows:

function dayMouseOver()
{
this.className = "over";
this.style.backgroundColor = WebCalendar.darkColor;
if(WebCalendar .day[this.id.substr(8)].split("/")[1] == WebCalendar.thisMonth)
this.style.color = WebCalendar.lightColor;
}
function dayMouseOut ()
{
this.className = "out"; var d = WebCalendar.day[this.id.substr(8)], a = d.split("/");
this. style.removeattribute("backgroundColor");
if(a[1] == WebCalendar.thisMonth && d != WebCalendar.today)
{
if(WebCalendar.dateStyle && a[0] == parseInt(WebCalendar.dateStyle[4], 10))
this.style.color = WebCalendar.lightColor;
this.style.color = WebCalendar.wordColor;
}
}

modified to
Copy the code The code is as follows:

var bgbgbg;
function dayMouseOver()
{
this.className = "over";
bgbgbg=this.style.backgroundColor;
this.style.backgroundColor = WebCalendar.darkColor;
if(WebCalendar .day[this.id.substr(8)].split("/")[1] == WebCalendar.thisMonth)
this.style.color = WebCalendar.lightColor;
}
function dayMouseOut ()
{
this.className = "out"; var d = WebCalendar.day[this.id.substr(8)], a = d.split("/");
this. style.backgroundColor = bgbgbg;
if(a[1] == WebCalendar.thisMonth && d != WebCalendar.today)
{
if(WebCalendar.dateStyle && a[0] == parseInt(WebCalendar .dateStyle[4], 10))
this.style.color = WebCalendar.lightColor;
this.style.color = WebCalendar.wordColor;
}
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn