+ -
当前位置:首页 → 问答吧 → JS 函数求教

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样式,怎么提示找不倒函数啊

作者: SHANDIANDIAN   发布时间: 2011-11-25

我这边运行没问题,你其他代码 有问题

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

相关阅读 更多

热门下载

更多