function load_events()
{
var mz_editor_events = document.getElementById("mz_ico").getElementsByTagName("*");
var event = event || window.event;
for(i=0 ; i<mz_editor_events.length ; i++)
{
if(mz_editor_events[i].className == "mz_icon_inline")
{
try{
mz_editor_events[i].addEventListener("mousemove",function(){e_move(this);},true);
mz_editor_events[i].addEventListener("mouseout",function(){e_out(this);},true);
mz_editor_events[i].addEventListener("mousedown",function(){e_down(this);},true);
}
catch(e){
mz_editor_events[i].attachEvent("onmousemove",function(){e_move(mz_editor_events[i]);});
mz_editor_events[i].attachEvent("onmouseout",function(){e_out(mz_editor_events[i]);});
mz_editor_events[i].attachEvent("onmousedown",function(){e_down(mz_editor_events[i]);});
}
}
}
}function e_move(id)
{ id.className = "mz_icon_online";}
function e_out(id)
{ id.className = "mz_icon_inline";}我的firefox 下面 和ie9下面都正常
ie6-ie8 会报id underfined is null or not an obiect
{
var mz_editor_events = document.getElementById("mz_ico").getElementsByTagName("*");
var event = event || window.event;
for(i=0 ; i<mz_editor_events.length ; i++)
{
if(mz_editor_events[i].className == "mz_icon_inline")
{
try{
mz_editor_events[i].addEventListener("mousemove",function(){e_move(this);},true);
mz_editor_events[i].addEventListener("mouseout",function(){e_out(this);},true);
mz_editor_events[i].addEventListener("mousedown",function(){e_down(this);},true);
}
catch(e){
mz_editor_events[i].attachEvent("onmousemove",function(){e_move(mz_editor_events[i]);});
mz_editor_events[i].attachEvent("onmouseout",function(){e_out(mz_editor_events[i]);});
mz_editor_events[i].attachEvent("onmousedown",function(){e_down(mz_editor_events[i]);});
}
}
}
}function e_move(id)
{ id.className = "mz_icon_online";}
function e_out(id)
{ id.className = "mz_icon_inline";}我的firefox 下面 和ie9下面都正常
ie6-ie8 会报id underfined is null or not an obiect
解决方案 »
- 弱弱的问一下,当用户点击浏览器的后退按扭是,可不可以在当前页面,调用一个js函数
- 谁帮解释哈这个算法
- js 如何获取窗体大小变化 的 事件?在线等
- javascript变量相加问题
- 怎么取得id为 "sub"+数字 的所有div?
- 如何设计当鼠标移到图片上时,自动弹出网页
- 如何用前台的Javascript取得DataGrid的一个值
- jquery ui layout 分栏效果,遇到一个bug,求解决
- 请问如何在网页中实现onmousedown和ondblclick
- 如何在JS文件里访问取数据字段的值?
- EXTJS buttons按钮样式
- 写了段javascript代码,结果发现有兼容性问题,请求高手指正。
{
}