Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to render a Rails Partial with a Mousenter event
  2. <div class="box">
  3.    change me out
  4.  </div>
  5.  
  6.  <div class="box">
  7.    <p>change me out</p>
  8.  </div>
  9.        
  10. <div class="update">
  11.   <p>You've been changed</p>
  12. </div>
  13.        
  14. var boxHtml = $(".box").html();
  15.  
  16. $(".box")
  17.     .mouseover(function() {
  18.             $(".box").html("<%= escape_javascript(render(:partial => 'more_info')) %>");      
  19.     })
  20.     .mouseout(function() {
  21.            $(".box").html(boxHtml);
  22.     });