Rails 3 UJS - 悬停时,而不是单击时
对于我的显示操作,我渲染 show.js.erb。当我单击使用 :remote => 设置的 link_to 时,会发生这种情况true 选项。我该如何设置才能在悬停时触发?
For my show action, I render show.js.erb. This happens when I click a link_to set up with a :remote => true
option. How can I set it up so this is triggered on hover?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一个带有不会触发 Rails-UJS 驱动程序的属性的链接:
然后连接您自己的事件:
Create a link with an attribute that won't trigger the Rails-UJS driver:
and then wireup your own event:
HTML5 自定义数据属性 FTW!
http:// /dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data-with-the-data-attributes
HTML5 custom data attributes FTW!
http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data-with-the-data-attributes