Resizing of Image

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
singareddy
Posts: 23
Joined: 28 Dec 2012, 21:26

19 Nov 2019, 09:58

We have used following style for resizing of image and it is working perfectly fine.

Code: Select all

<p:graphicImage url="#{image}"  style="position: relative; object-fit: cover; overflow: hidden; height=100%; width=100%;border-radius: 1px"
 oncontextmenu="javascript:return false;" />
But when we use same code inside ImageSwitch and it does not work any Idea?

Code: Select all

<p:imageSwitch effect="zoom"  >
<p:repeat value="#{photoView.images}" var="image">
<p:graphicImage url="#{image}"  style="position: relative; object-fit: cover; overflow: hidden; height=100%; width=100%;border-radius: 1px"
 oncontextmenu="javascript:return false;" />
</p:repeat>
</p:imageSwitch>
Here is the example

https://ooftish.com/photos/fX4TD2w2/index.xhtml

Your help in this regard greatly appreciated.
Thanks

Ravi

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

23 Dec 2019, 09:35

Hi,

Could you please try the following css?

Code: Select all

<p:imageSwitch styleClass="imageSwitchClass" .../>

.imageSwitchClass {
    width: 100% !important;
}

.imageSwitchClass img {
   width: 100% !important;
   height: 100% !important;
}
Best Regards,

Post Reply

Return to “Ultima - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests