I have a jquery hover script which works fine until I used the drop down created by exposed filters. It works on the initial ajax call to the 4 contents types in the drop down, but when I go back to "any" or any of the other content types it stops working. Thanks in advance for any help on this.

jQuery(document).ready(function()
	{
		jQuery(".main-thumb").hover(function()
		{
 			jQuery(this).find(".thumb_title a").fadeIn();
			jQuery(this).find(".thumb_body").fadeIn();
			jQuery(this).find(".thumb_more").fadeIn();
		},
	function()
	{
		jQuery(this).find(".thumb_title a").fadeOut();
		jQuery(this).find(".thumb_body").fadeOut();
		jQuery(this).find(".thumb_more").fadeOut();
	}
	);
		///////////////////////////////////////////////////////////////////////////////
	
	})

Comments

jrcholtz’s picture

subscribe i have the same problem, when I used Better exposed filters I use auto-submit and the hover comes back, but I don wan autosub!

TimeBandit’s picture

Same here, Views 6.x-3.0. Custom hide/show jquery code works before ajax update. In my case the view is in a block and so the exposed filters must be ajax.

Edit: i see now this isn't a drupal issue. JQuery has issues with events post-ajax, depending on the JQuery version. Maybe look into on(), delegate() [for older JQ] and live() [for even older JQ].

mtilton63’s picture

This might help. Note "ajaxStop". It reloads your functions after the ajax call.

//RUN FUNCTION AFTER AJAX CALL
$( document ).ajaxStop(function() {

});
chintan4u’s picture

There is an event which will be useful for this problem .ajaxComplete()
Please take a look at http://api.jquery.com/ajaxComplete/

Try your luck with below code.

jQuery(document).ajaxComplete(function() {

mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)