Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoomed image is cut-off by parent overflow:hidden #61

Open
Knordy opened this issue Oct 27, 2015 · 4 comments
Open

Zoomed image is cut-off by parent overflow:hidden #61

Knordy opened this issue Oct 27, 2015 · 4 comments

Comments

@Knordy
Copy link

Knordy commented Oct 27, 2015

Our layout contains the images in a div with the style overflow:hidden. When the images are zoomed they do not act as a true overlay and are cut off by this parent div.

I couldn't create a fiddle, but you can replicate this behaviour by adding this to your site:

<div style="position:relative;">
  <div style="overflow:hidden;">
    <img src="img/palm.jpg" data-action="zoom">
  </div>
</div>

As you can see by clicking the palm img, the image will be zoomed, and cut off.
According to this site it should be possible with a different css positioning.

@claudiofrs
Copy link

I'm having the same problem.

edited:
I'm adding the click action to the element you want to click to zoom, for changing the css from overflow hidden to visible.

And to turn it again to hidden, I tweak the zoom.js prototype function a little bit by adding a custom function to toggle css styling from visible to hidden in Zoom.prototype.close.

@ElegantSudo
Copy link

ElegantSudo commented May 9, 2016

I'm having this issue too. @claudiofrs that's awesome! Would you be able to create a fork of your solution with the additions you suggested and possibly a small (doesn't have to be pretty) example?

I'd love to dive in and check it out.

@kitce
Copy link

kitce commented Jun 29, 2016

It adds a class "zoom-overlay-open" to "body" element when an image is zoomed, so I think overriding the css would be good enough in this case:

.zoom-overlay-open .originally-hidden-element {
  overflow : initial;
}

@ElegantSudo
Copy link

ElegantSudo commented Jun 30, 2016

@kitce this is the issue we're talking about: http://codepen.io/yipyop/pen/RRpOKQ. I don't know if what you're saying makes sense with that example.

It's really about the parent element that the image is contained within.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants