otronics Posted June 3, 2014 Share Posted June 3, 2014 (edited) Hi. I am in need of help with an image gallery. At present in the gallery, when you click on the main image, it takes you to another page. All the big images link to other pages. What I would like is for the Thumbnails to do the same - link to the other pages and not scroll when clicked on. Tried tweaking the code behind it myself and no luck yet. Any ideas? Many thanks. Edited June 30, 2014 by otronics Link to comment Share on other sites More sharing options...
justsomeguy Posted June 3, 2014 Share Posted June 3, 2014 If you search through the gallery code for "gv_thumbnail" you should be able to find the places where it assigns event handlers to the thumbnail images. Link to comment Share on other sites More sharing options...
otronics Posted June 4, 2014 Author Share Posted June 4, 2014 Thanks for this. What code would I need to add/adjust exactly? Link to comment Share on other sites More sharing options...
justsomeguy Posted June 4, 2014 Share Posted June 4, 2014 Somewhere in there it is going to assign a click handler to those elements. You can change that click handler so that it opens the image instead of doing whatever it's doing now. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 4, 2014 Share Posted June 4, 2014 The click handler for the thumbnails gets assigned on line 873. The call to self.showItem is what changes the big image. The updateClickable function on line 918 is what runs when you click on the big image. Link to comment Share on other sites More sharing options...
otronics Posted June 5, 2014 Author Share Posted June 5, 2014 So, do I need to copy the updateClickable to the filmstrip images call function? Sorry - learning about JQuery and am finding it difficult so far! Link to comment Share on other sites More sharing options...
justsomeguy Posted June 5, 2014 Share Posted June 5, 2014 Start by studying the updateClickable function so that you can understand what it's doing. It would probably help to use breakpoints for that, in your browser's developer tools. Use the script tab to look at that code, and set breakpoints on each line. When the function runs it will stop at each breakpoint and you can check things like what the various variables are set to and you can trace through the code to see what path it takes and what it does. Once you understand how the function works, then you can copy the parts that you need to the other one. I doubt it would work to copy the exact code and expect everything to work the same. I used breakpoints though to verify that those were the functions that ran when you click on something. 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