- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 Backbone.js 的代码的 View 部分是这样的:
var myView = Backbone.View.extend({
events: {
'focus .cell input' : "updateCurrentCell"
},
updateCurrentCell: function(event) {
console.log('updateCurrentCell called');
// Update the current cell.
}
}
console.trace()
打印堆栈跟踪.它表明一旦函数调用源自
关注 下一次从
开始的事件关注 .
最佳答案
Backbone.View 使用 delegateEvents绑定(bind)事件对象中列出的事件。如果你看看 source ,你会看到 delegateEvents
使用 jQuery.delegate这样做。
在 jquery 文档中有一条注释 .focus()这可能是相关的:
The focus event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the focus event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping focus to the focusin event in its event delegation methods, .live() and .delegate().
关于focus - Backbone.js 焦点事件触发两个事件 focus 和 focusin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7007801/
当我将焦点放在某个元素上时,我希望选中所有文本。 我用过 $('.class-focusin').focusin(function(e) { $(this).select(); }); 但这不
我在做什么 在代码的某些部分,我有一个针对 focusin 事件的监听器,而在另一部分中,我以编程方式将焦点设置在 input 上。在 Chrome、Safari、Firefox 上,事件监听器被调用
我使用的是 JQuery 1.4.1。我有动态创建的 HTML 输入元素。我已将“focusin”事件分配给所有输入元素。加载页面时,仅在聚焦每个输入元素时触发一次。 问题是,当我最小化和最大化页面时
我正在验证表单输入,例如单击按钮时说名字。如果为空,我将类更改为 .ValidateError { border: 3px solid #ff9600; background:
我想在 focusin 上显示一个按钮,单击时执行一些操作或在 focusout 上隐藏该按钮: $(".editableDiv").live('focusin', function(){ /
我是第一次使用 Python 3.4 和 Qt 5。这很简单,我可以理解我需要的大部分功能。但是(总是有“但是”)我不明白如何使用 focusOut/clearFocus/focusIn 事件。 我的
为什么在 following code未调用 focusin 事件处理程序? HTML: Click Here JS: $(function() { $('input').live('fo
我一直在修改 jQuery 事件,并且偶然发现了一个非常有趣的情况(Firefox bug?),我找不到任何解释。我想对某些 HTML 元素使用焦点事件,但似乎有一些限制,例如: 段落、div(可能还
当我点击 内部时下面的标签,alert()单击 alert() 的“确定”按钮后,继续出现以下代码中的内容。 单击“确定”按钮后我需要做什么才能停止警报?我的代码需要脱离输入标记并执行一些其他操作。
据我了解,只要窗口获得焦点,就会触发 X11 FocusIn 事件。它是键盘输入发送到的窗口。我无法触发此事件。我确保在创建窗口时给它 FocusChangeMask。我在我的事件处理程序中创建了一个
感谢Perfection kills ,我们可以使用以下 JavaScript 来检测事件支持: function hasEvent(ev) { var elem = document.cre
我正在创建一个小的 PyQt 应用程序并卡在了鼠标悬停效果中。 我有一个 QMainWindow,它有三个按钮,分别是 createProfileButton、downloadPackagesButt
jQuery 版本:1.4.1 我正在尝试编写一个简单的水印类型插件,并且我想利用实时事件,因为并非所有我需要使用它的元素都会在页面加载期间存在,或者它们可能会从页面中添加和删除DOM。然而,由于某种
我尝试在 focusin 内调用 focusout 事件,因为我想使用 focusin 事件中的先前值,但 focusout 事件执行多次 $('tr #edituser').focusin(func
jQuery 版本:1.10.1 我正在尝试编写一个工具提示,单击列表中的每个图像项时将显示什么。但是,在单击项目之前,工具提示会显示 html 内容,如 鼠标悬停时。请在下面查看我的尝试: $('#
我有一个包含这样一列的数据表 这是我的HTML 78060 Edit View 我想在用户将鼠标悬
我想将类名 active 添加到父类 的this 。无法弄清楚为什么它只针对第一个输入。没有 jQuery。 http://jsfiddle.net/58ddtbm9/ document.queryS
我需要在 JQuery 中使用 focusin 和 focusout 触发器。我将它与 Bootstrap Popovers 一起使用。 目前,由于我认为某些奇怪的原因,它不起作用。 这有什么问题吗?
我在一个类中有一个 focusin 绑定(bind)。我试过 jQuery unbind 方法。似乎不起作用。 这只是一个例子: module TheClas
我的 Binder : $("#wrapper").on("focusin", ".someInputField", function(e, a) { /* do something */ }
我是一名优秀的程序员,十分优秀!