MyBB Community Forums

Full Version: Can't Resolve This jQuery Conflict :(
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to put a jQuery conflict away between the code below and the buddy list popup but nothing seems to work. I know that this code is only causing the conflict because when I remove it, the buddy list pops up.

Here is the code:

 var srl = jQuery.noConflict();
 srl(document).ready(function($){
 var shrinkHeader = 300;
  srl(window).scroll(function() {
    var scroll = getCurrentScroll();
      if ( scroll >= shrinkHeader ) {
           srl('.header').addClass('shrink');
        }
        else {
            srl('.header').removeClass('shrink');
        }
  });
function getCurrentScroll() {
    return window.pageYOffset;
    }
	});
you can change var srl = jQuery.noConflict(); to var srl = jQuery;
(2015-06-17, 10:51 AM).m. Wrote: [ -> ]you can change var srl = jQuery.noConflict(); to var srl = jQuery;

That worked out, thank you Big Grin