Am not sure what is happening and why. But when I enable this module I have several issues with the pages where jquery is used.

A simple example

jQuery(document).ready(function($){
	
	$('#block-menu-menu-members-tem-4 li.last').mouseenter(function(){
		$('#block-menu-menu-members-tem-5').show();
		});
	$('#block-menu-menu-members-tem-4 li.last').mouseleave(function(event){
		var toElem = $(event.relatedTarget);
		if (toElem.closest("nav").is("#block-menu-menu-members-tem-5")) return;
		$("#block-menu-menu-members-tem-5").hide();
		});
	$("#block-menu-menu-members-tem-5").mouseleave(function (event) {

		$("#block-menu-menu-members-tem-5").hide();
		});

	$('#block-menu-menu-members-tem-5 li').hover(function(){
		$(this).css("background-color","#8d83d6");
		},
		function() {
		$(this).css("background-color", "transparent");
		});
		
});

This shows a block when hovering over a certain menu item and hides it when moving away. Is a very basic setup and works perfectly. However as soon I enable jquery-update version 7.22 it does not work anymore. It is not even registering the event when the page loads.

My javascripting knowledge is very limited and would like to have some help here. Why is it breaking this javascript? I have several things which stop working as mentioned in another issue.

Comments

erald’s picture

ahh well got it why. You got to use

(function ($) {
Drupal.behaviors.A_NAME = {
  attach: function (context) {
   ... code

}
}
})(jQuery);

Sounds simple but is just something to know. All my scripts start working again. Probably should have read the documentation on Drupal 7 a bit more carefull.

markhalliwell’s picture

Category: Bug report » Support request
Issue summary: View changes
Status: Active » Closed (works as designed)

Not an issue with this project.