orion3dgames / gridder

A jQuery plugin that displays a thumbnail grid expanding preview similar to the effect seen on Google Images.
http://orion3dgames.github.io/gridder/
461 stars 130 forks source link

Extend Request: Ability to target a specific element within the gridder-list #57

Open justinbhayes opened 6 years ago

justinbhayes commented 6 years ago

Can you add the ability to target a specific element within the gridder list as the trigger to open the gridder content/show area?

orion3dgames commented 6 years ago

Yes you can do that using jQuery trigger like this: jQuery('.gridder . gridder-list:nth-child(2)').trigger('click'); // This will select the second child of the list a trigger the opening. Cheers, Orion.

On 7 October 2017 at 01:22, Justin notifications@github.com wrote:

Can you add the ability to target a specific element within the gridder list as the trigger to open the gridder content/show area?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oriongunning/gridder/issues/57, or mute the thread https://github.com/notifications/unsubscribe-auth/AE2BxDkDV3zsboB8U5KLLPHKAipD2lFTks5spjepgaJpZM4Pwjp7 .

-- Orion GUNNING Tél. : 04 35 30 75 13 http://www.orion3d.fr/

justinbhayes commented 6 years ago

Thanks for the quick reply. I should have been more specific. I want to remove the regular trigger and then add a new one. For example, I only want clicking "Member Title #" to trigger the associated gridder content. https://is.gd/C6Il4M

justinbhayes commented 6 years ago

Ideally I would like to change the selector for the click event, but that isn't working. _this.on("click", ".gridder-list h4", function (e) { e.preventDefault(); var myself = $(this); openExpander(myself); });

I assume the following line needs to be updated to target it's parent .gridder-list? var myself = $(this);

justinbhayes commented 6 years ago

I was able to get my gridder functioning the way I wanted with this update. _this.on("click", ".bio", function (e) { e.preventDefault(); var myself = $(this).closest("li"); openExpander(myself); });