其实我的问题是不同的。
我在我的小盒子中的第一个表单元素的 .focus 事件上调用了一个函数,如下所示。
$(".tbox :input:visible:enabled:first").focus(function () {
tabIndexForm();
});
它工作得很好,但这正在替换我自己在我手动设置的表单的第一个元素上调用 onfocus 事件的函数。这个怎么做。我的表格是:
<form name="exampleform">
<input type="text" name="a" onfocus="somefunction();"/>
<input type="text" name="b"/>
</form>
现在,当我打开小盒子时,tabIndexForm 函数完美调用,但是 somefunction() 不起作用,因为我认为 tabIndexForm 替换了这个函数。如何更新以下代码以同时工作。
$(".tbox :input:visible:enabled:first").focus(function () {
tabIndexForm();
});
重要提示:我不能在 tinybox.js 中调用“somefunction()”,因为这对所有小盒子都很常见。