JS 函数求教
时间:2011-11-25
来源:互联网
function edit_border_show(id){
id.className ="mz_icon_inline";
}
function edit_border_hide(){
}
var load_editor = function(){
var editor="";
for(i=0;i<editorbar.length;i++)
{
editor += '<span id="'+editorbar[i][0]+'" class="mz_icon_url mz_ico_'+editorbar[i][0]+ '" title="'+editorbar[i][1]+'" onmousemove="edit_border_show(this)" onmouseout="edit_border_hide(this)"></span>';
}
return editor;
}
document.getElementById("admin_postnews_2_1").innerHTML = load_editor();
要调用外部的edit_border_show 函数 设置CSS样式,怎么提示找不倒函数啊
id.className ="mz_icon_inline";
}
function edit_border_hide(){
}
var load_editor = function(){
var editor="";
for(i=0;i<editorbar.length;i++)
{
editor += '<span id="'+editorbar[i][0]+'" class="mz_icon_url mz_ico_'+editorbar[i][0]+ '" title="'+editorbar[i][1]+'" onmousemove="edit_border_show(this)" onmouseout="edit_border_hide(this)"></span>';
}
return editor;
}
document.getElementById("admin_postnews_2_1").innerHTML = load_editor();
要调用外部的edit_border_show 函数 设置CSS样式,怎么提示找不倒函数啊
作者: SHANDIANDIAN 发布时间: 2011-11-25
我这边运行没问题,你其他代码 有问题
HTML code
HTML code
<html> <head> <style> .mz_icon_inline{ background-color:red; } </style> </head> <body> <div id="admin_postnews_2_1"> </div> <script> editorbar = [ ["a1","a2"], ["b1","b2"], ["c1","c2"] ] function edit_border_show(id){ id.className ="mz_icon_inline"; } function edit_border_hide(){ } var load_editor = function(){ var editor=""; for(i=0;i<editorbar.length;i++) { editor += '<span id="'+editorbar[i][0]+'" class="mz_icon_url mz_ico_'+editorbar[i][0]+ '" title="'+editorbar[i][1]+'" onmousemove="edit_border_show(this)" onmouseout="edit_border_hide(this)">'+editorbar[i][0]+'</span>'; } return editor; } document.getElementById("admin_postnews_2_1").innerHTML = load_editor(); </script> </body> </html>
作者: p2227 发布时间: 2011-11-25
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28