zoomable class set on wrong div
See original GitHub issueI found this project very useful for a simple showcase site and it looks very promising!
However, after basically having adapted the standard demo, it seems the documentation in the Readme needs to be updated, at least the options and events section. Some of the options are not mentioned and some options overrides other options.
As I could not get my local demo to zoom and rotate on hover, I looked in the source files while analyzing the output in chrome dev tools.
Accordingly, there seems to be an issue with the class zoomable
being set on the wrong div
.
The zoomable
class must be set on the div
having the rotation
, ie. the div
containing the image url in its style
attribute:
https://github.com/Ecodev/natural-gallery-js/blob/9d5e1cc867f3d269a30c1ad605c9f2222e87b30c/app/js/Item.ts#L184-L186
In current version 2.7.4 the zoomable
class is added to the parent div
, the one with the classes figure loaded visible
. After a live manipulation with chrome dev tools switching where the zoomable
class is added, the hover effect is working as expected.
I’m not fully aware how to build a new dist from the sources, so unfortunately no pull request from my side on this one. Hoping for a fix, though 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
Ok I could reproduce, but I have to check deeply the cause of this bug.
I use this library in a big project and the zoom works fine with this version, so I have to be sure before changing that class.
Will be fixed soon.
I’ve just pushed a fix.
The patch you suggest ignores the case where lightbox = false, and there is no zoom on click. The class “zoom” should not be applied unconditionally.
The bug happened when there is no “button” on thumbnails (it’s your case : you have a label).
Enjoy.