treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Jquery on Rollover?

  • Hello,

    I can't seem to get this code to act onRollover. It sounds like it would make total sense but I keep breaking it every time. Any thoughts?

    Taken from the tutorial found here: http://net.tutsplus.com/javascript-ajax/create-a-tabbed-interface-using-jquery/
    This is my function I've placed at the top of the page:

    $(function() {
    $('#tabvanilla > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
    });

    If you need any other code don't hesitate to shout.

    Thanks!!
  • You need the document.ready:


    $(document).ready(function() {
    $('#tabvanilla').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
    });
  • Hah. That worked. Duh. Better to be wrong because of a brain fart I suppose. :)