Conflict occurs while adding a jquery for sticky div in joomla
<p>I need a header that sticks to the top while scrolling down the page. Am using the following jquery function </p>

<pre><code>&lt;script type="text/javascript"&gt;
google.load("jquery", "1");

function sticky_relocate() {
  var window_top = $(window).scrollTop();
  var div_top = $('#sticky-anchor').offset().top;
  if (window_top &gt; div_top)
    $('#sticky').addClass('stick')
  else
    $('#sticky').removeClass('stick');
  }
// If you have jQuery directly, use the following line, instead
// $(function() {
// If you have jQuery via Google AJAX Libraries
google.setOnLoadCallback(function() {
  $(window).scroll(sticky_relocate);
  sticky_relocate();
  });
&lt;/script&gt; 
</code></pre>

<p>but the sliders already present in the page not functioning! Please help me to solve this issue.
I have added <code>$.noConflict();</code>above the function the slider works properly and sticky div is not working!</p>

<p>And have made following changes to the code // Start closure to prevent namespace conflicts</p>

<pre><code>;(function($) {

// Whatever code you want that relies on $ as the jQuery object

// End closure
})(jQuery);
</code></pre>

<p>both the slider and sticky div not working!</p>
