Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于我的表演动作,我渲染 show.js.erb。当我单击一个带有:remote => true选项的链接设置时会发生这种情况。如何设置它以便在悬停时触发?
:remote => true
使用不会触发 Rails-UJS 驱动程序的属性创建链接:
<%= link_to 'mouse over me!', '#', :'data-remote-on-hover' => true %>
然后连接你自己的事件:
$('a[data-remote-on-hover]').hover(function() { // do something })
HTML5 自定义数据属性 FTW!
http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data-with-the-data-attributes