Unable to load image

u know the pinch zoom on mobile ?

how do u undo it via js ?


use case:

heres what happens currently (on mobile):

1. user sees expandable image

![](https://i.rdrama.net/images/16784800606710851.webp)

2. user click on image to expand it

![](https://i.rdrama.net/images/16784800612016382.webp)

3. users pinches to zoom on image

![](https://i.rdrama.net/images/16784800617413743.webp)

4. user closes the image - page is still zoomed, user must unzoom manually

![](https://i.rdrama.net/images/16784800622519965.webp)

I want it so the page gets unzoomed automatically when user closes the image, is this possible ?

36
Jump in the discussion.

No email address required.

Have you tried asking chatGPT?

Jump in the discussion.

No email address required.

@bbbb how do i do the pinch unzoom in javascript?

Jump in the discussion.

No email address required.

This is not a question that can be succinctly answered in a single comment. If you are looking for a detailed explanation, you can find plenty of tutorials with a simple Google search. However, if you are simply looking for a quick answer, the code you are looking for is as follows:

Jump in the discussion.

No email address required.

>This is not a question that can be succinctly answered in a single comment.

>the code you are looking for is as follows:

And people say bots can't do comedy :!marseyxd:

Jump in the discussion.

No email address required.

Nonsense. Bots are the future of comedy. They never get tired, they never get sick, and they can work 24/7. With the right programming, they can be even funnier than humans.

Jump in the discussion.

No email address required.

You can use the touchstart event in JavaScript to detect when the user has zoomed in on their smartphone, and then reset the zoom level back to 1 when the expandable image is closed.

The expandImage function creates an overlay element with a semi-transparent background and an image element inside it. When the image is clicked, the overlay is added to the body and the image is displayed inside it.

The touchstart event listener detects when the user has zoomed in on their smartphone, and resets the zoom level back to 1 when this happens.

When the user taps on the overlay to close the expandable image, the overlay is removed from the body and the zoom level is reset back to 1.

:#marppy:

Jump in the discussion.

No email address required.

AAAAAAAAAHH IM ZOOMING

Jump in the discussion.

No email address required.

ZOOMERS OUT

Jump in the discussion.

No email address required.

I want it so the page gets unzoomed automatically when user closes the image, is this possible ?

So making the image pop up its own separate thing from the rest of the page? Sorry, I can’t be very helpful; I am not a codecel. Pretty sure it is possible though.

Jump in the discussion.

No email address required.

Phone posters are scum and don't deserve any optimisation work

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

I'm a zoomer i'm a zoomer i'm zooming today

I'm a zoomer i'm a zoomer i'm zooming today

I'm zoooooooooooooming I'm zoooooooooooooming

:#marseysing:


https://i.rdrama.net/images/17187151446911044.webp https://i.rdrama.net/images/17093267613293715.webp https://i.rdrama.net/images/17177781034384797.webp

Jump in the discussion.

No email address required.

Zoom out the day

Zoom out the night

Can’t see no reason to put up a fight

I’m living for giving the capy his due

And I’m zoomin, I’m zoomin, I’m zoomin for you

I’m zoomin, I’m zoomin, I’m zoomin for you

Jump in the discussion.

No email address required.

As a phonechad, it did this before but it stopped

Hope this helped

Jump in the discussion.

No email address required.

it didnt actually unzoom, it just went back to the previous page (the expanded image was treated as a new page)

Jump in the discussion.

No email address required.

:#marseyshook:

Pulled the wool over my eyes ngl

Jump in the discussion.

No email address required.

Lazy way is to change the style to reset zoom in js as on an onclick/onTouch event on the background. More complicated is to implement your own CSS zoom on the image only. I'm on mobile now but I can come up with a small sample later when I have time


:#marseyviewerstaretalking:

Jump in the discussion.

No email address required.

yes u just need the autofingers phone attachment it clips on to your phone case and moves like fingers. i sell them for 4.99/ea then you can distribute to users

Jump in the discussion.

No email address required.

Im zoooming

Jump in the discussion.

No email address required.

The answer is no, it is not possible.

Jump in the discussion.

No email address required.

Please dont try fixing this its not an actual problem and whatever change you implement will be mildly annoying to adjust to


https://i.rdrama.net/images/17035381209726467.webp

Jump in the discussion.

No email address required.

Posted about this on the bug reports thread a while back, I could swear it used to unzoom automatically a few months back

Jump in the discussion.

No email address required.

it didnt actually unzoom, it just went back to the previous page (the expanded image was treated as a new page)

Jump in the discussion.

No email address required.

Yes

Jump in the discussion.

No email address required.

:#marseyschizosal:

Snapshots:

![](https://i.rdrama.net/images/16784800606710851.webp):

![](https://i.rdrama.net/images/16784800612016382.webp):

![](https://i.rdrama.net/images/16784800617413743.webp):

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.