question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

zoomable class set on wrong div

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sambaptistacommented, Apr 3, 2018

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.

0reactions
sambaptistacommented, Apr 6, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zoom Effect using css but the size of the div should be fixed
I want that zoom effect to take place without the div zooming on. Only the image should zoom inside the div.`I don't know...
Read more >
[Solved] allow zoom without affecting layout - CSS-Tricks
How can I allow user to zoom in and out without affecting the viewport size? For example: The actual device width is: 1920px...
Read more >
Image Zoom - Sirv Media Viewer Documentation - Sirv
Sirv Media Viewer's Image Zoom module is a must-have for every e-commerce website. It's fast, highly customizable and free to try. Give it...
Read more >
Using JQuery Zoom and JavaScript Zoom for Product Images ...
Image zoom is an important product feature for merchants, allowing buyers to enlarge product photos for better viewing.
Read more >
Zoomooz.js - GitHub Pages
Zoomooz is a jQuery plugin for making web page elements zoom. ... zoom to when clicked on: <div class="zoomTarget">This element zooms when clicked...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found