77
Views
4
Comments
Solved
How to make image zoomable
Question
Application Type
Reactive

Hi all,

Maybe a trivial question, but I'd like to ask how to make a image zoom-in and out like the way we have in any of the Outsystems document.

For example: https://success.outsystems.com/documentation/11/building_apps/user_interface/screen/

The desired behaviors:

  1. When mouse hover to image, the pointer changes to magnitude glass with + icon
  2. Then, if the image is clicked, image will be zoomed in, and the pointer now changes to magnitude glass with - icon
  3. Then, if the image is clicked again, it will be zoomed out, and the pointer backs to magnitude glass with + icon


I have a feeling that this can be done with CSS, but I'm not sure.

Thank you

2020-11-25 10-45-32
Mostafa Othman
Champion
Solution

Hello,

You can open developer tool from your browser and check CSS used for the image that  you posted here in your question when you click it to zoom in an zoom out.

I found these two CSS which are used for the image:

Normal image: 

img.fr-dib {

    display: block;

    float: none;

    vertical-align: top;

}


After click image (zoom in)

.zoom {

    border: var(--border-size-s) solid #9E9E9E;

    border-radius: var(--border-radius-mid-rounded);

    cursor: -webkit-zoom-out;

    max-width: 100%;

    transform: scale(2);

    transition: all 0.5s;

    z-index: 100;

}

UserImage.jpg
Cuong Tran

Thank you very much. Your solution is indeed what I imaged.

Although you have given me a hint for thinking, @Gorantla Srujan Kumar supported me with a working .oml file. Therefore I'd like to also credit him as a solution.

Best regards,

UserImage.jpg
Gorantla Srujan Kumar
Solution

Hello @Cuong Tran 

kindly refer this OML

Thanks 

ImageZoomIN_ZoomOut.oml
2020-11-25 10-45-32
Mostafa Othman
Champion
Solution

Hello,

You can open developer tool from your browser and check CSS used for the image that  you posted here in your question when you click it to zoom in an zoom out.

I found these two CSS which are used for the image:

Normal image: 

img.fr-dib {

    display: block;

    float: none;

    vertical-align: top;

}


After click image (zoom in)

.zoom {

    border: var(--border-size-s) solid #9E9E9E;

    border-radius: var(--border-radius-mid-rounded);

    cursor: -webkit-zoom-out;

    max-width: 100%;

    transform: scale(2);

    transition: all 0.5s;

    z-index: 100;

}

UserImage.jpg
Cuong Tran

Thank you very much. Your solution is indeed what I imaged.

Although you have given me a hint for thinking, @Gorantla Srujan Kumar supported me with a working .oml file. Therefore I'd like to also credit him as a solution.

Best regards,

2024-03-22 09-17-23
Chandra Vikas Sharma

Hi,

You can also use below forge component for zooming facility.

https://www.outsystems.com/forge/component-overview/10275/image-magnifier-glass-o11

Thanks 

Cv

UserImage.jpg
Gorantla Srujan Kumar
Solution

Hello @Cuong Tran 

kindly refer this OML

Thanks 

ImageZoomIN_ZoomOut.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.