title: Adding hover CSS attributes via jQuery/Javascript
body: <p>Some CSS styles need to be applied to an element on hover, and CSS styles have to be applied using javascript/jquery directly and not through stylesheets or <code>$(this).addClass('someStyle')</code> because I am injecting the DOM elements into another page.</p>
  
  <p>We can apply the usual css styles using </p>
  
  <pre><code>$('#some-content').css({
      marginTop: '60px',
      display: 'inline-block'
  });
  </code></pre>
  
  <p>How should we add the CSS styles for <code>:hover</code> events?</p>
  
  <hr>
  
  <p>Do we have to resort to:</p>
  
  <pre><code>$('#some-content').hover(
         function(){ $(this).css('display', 'block') },
         function(){ $(this).css('display', 'none') }
  )
  </code></pre>