Jquery not working in Drupal? $ is not a function?

Warning message

JQuery Cycle must be installed in order to run the slideshow. Please go to Status Report for instructions.

Primary tabs

To resolve this error you must wrap your JavaScript inside function like this :

(function ($) { 
  // Your jQuery code.
  $('#something1').click(function () {
    $('#something2').slideToggle();
  });
  //Put your code between these comments.
})(jQuery);