crpereyra1 Posted May 22, 2014 Share Posted May 22, 2014 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 More sharing options...
vekia Posted May 22, 2014 Share Posted May 22, 2014 you have to run this function (to add hover effect) each time you will change product display method Link to comment Share on other sites More sharing options...
crpereyra1 Posted May 22, 2014 Author Share Posted May 22, 2014 What file would I do that in? Thank you Link to comment Share on other sites More sharing options...
vekia Posted May 22, 2014 Share Posted May 22, 2014 let me know what prestashop version you use :-) and also, what theme everything depends on these two things Link to comment Share on other sites More sharing options...
crpereyra1 Posted May 22, 2014 Author Share Posted May 22, 2014 Sorry. Version 1.6.0.6. Using the default theme that comes with install. Thanks again Link to comment Share on other sites More sharing options...
vekia Posted May 22, 2014 Share Posted May 22, 2014 /themes/default-bootstrap/js/global.js near line 175 there is a function: function bindGrid() add it there Link to comment Share on other sites More sharing options...
crpereyra1 Posted May 22, 2014 Author Share Posted May 22, 2014 I've added it where you said but it is still doing the same thing. I also put an alert on the bindgrid() function and it only fires once. Link to comment Share on other sites More sharing options...
vekia Posted May 22, 2014 Share Posted May 22, 2014 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 1 Link to comment Share on other sites More sharing options...
crpereyra1 Posted May 22, 2014 Author Share Posted May 22, 2014 That worked! Thank you very much! Link to comment Share on other sites More sharing options...
vekia Posted May 22, 2014 Share Posted May 22, 2014 you're welcome :-) i can go ahead and mark topic title as solved. with regards, Milos 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now