我有类似的东西
" _onmouseover " : "this.className=this.className.replace('hover', '')";
我正在尝试执行它
buttonObject.onmouseover = function() { window [ this.someObject._ _onmouseover ] () ; };
而且我不知道这怎么可能。
让我告诉你们我的情景。我正在创建这个插件来在 jquery 对话框中生成四种类型的对话消息。那些是“警告”、“错误”、“注意”和“确认”。因此,假设 dom 中有 4 个跨度应该触发这四个。
<span id='DialogueWarning'> Warning </span>
<span id='DialogueError'> Error </span>
<span id='DialogueNote'> Note </span>
<span id='DialogueConfirm'> Confirm </span>
现在让我们点击一下来显示对话
jQuery('#DialogueWarning').click(function(){
var dialogue = new Dialogue({
"type":"Warning",
"message":"Are you sure you want to close this window without saving your changes?",
"buttons":
[
{
"text":"Close without saving",
"_onmouseover": "this.className+=' hover'",
"_onmouseout":"this.className=this.className.replace(' hover', '')",
"bClass":"e_customButton"
},
{
"text":"Don't Close",
"_onmouseover": "this.className+=' hover'",
"_onmouseout":"this.className=this.className.replace(' hover', '')",
"bClass":"e_customButton"
}
],
"closeOnBackgroundClick" : true
});
});
请参阅“_onmouseover”和 _onmouseout 的东西,我需要这些。有什么办法可以让我通过另一种方式