Jump to content

[SOLVED] Jquery not working after changing product view


Recommended Posts

Hello,

 

I have some custom jquery on my global.js file.  All it does is show the product name when you hover over the product image. This is when the view is in grid view.  When I change to list view it is shown as normal.   It works fine when I first load the page and I am in grid view.  However, if I go to list view and then back to grid view, my jquery no longer works.  Or if I start from list view and go to grid view it no longer works.  I believe it has something to do with the click href="#"  I have tried inserting an alert to see if it is even going into the function but it is not.  

 

Any ideas what could be going on, or should I place my jquery in some other file?

 

Thank you,

Link to comment
Share on other sites

sorry that i missed one important thing

you have to add this code inside funcitons:

	$(document).on('click', '#grid', function(e){
		e.preventDefault();
		display('grid');
	});

	$(document).on('click', '#list', function(e){
		e.preventDefault();
		display('list');
	});

these funcitons are a part of bindgrid() function

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...