I´ve tried to use a p:imageSwitch in a p:dialog.
But currently I have a issue with the size. Because my picture is for example 1000x 600 px.
But the height and width is not repsonsive for mobile devices, iPad...
It´s always the full height and width. How can I solve this?
Here my code:
[img]<p:dialog id="showPictureDialog" widgetVar="showPictureDialog"
responsive="true" appendToBody="true" position="center"
showHeader="true" styleClass="custom-dialog" height="auto" width="auto"
header="Jetzt Bild herunterladen" maximizable="false"
minimizable="false" dynamic="false" modal="true" resizable="false"
closable="true" closeOnEscape="true">
<h:form id="showPictureDialogForm">
<p:commandLink oncomplete="PF('showPictureDialog').hide()" style="width: auto; max-width: auto; height: auto; text-align:center;"
ajax="true" immediate="true">
<p:imageSwitch id="fadeEffectDialog" effect="wipe"
widgetVar="imageSwitchDialog"
slideshowSpeed="#{gallerySlideshowController.slideShowSpeed * 1000}">
<ui:repeat id="fadeEffectImagesDialog"
value="#{gallerySlideshowController.selectedStorageAttachmentList}"
var="storageAttachment">
<p:graphicImage title="#{storageAttachment.id}"
style="width: auto; max-width: auto; height: auto; text-align:center;"
value="#{galleryPictureExtendedPictureRequestController.pictureExtended}">
<f:param name="id" value="#{storageAttachment.id}" />
</p:graphicImage>
</ui:repeat>
</p:imageSwitch>
</p:commandLink>
</h:form>
</p:dialog>[/img]
Code: Select all
<ui:define name="head">
<script type="text/javascript">
function addCustomClass() {
var modalDialogId = PF('showPictureDialog').cfg.id;
$(PrimeFaces.escapeClientId(modalDialogId + "_modal")).addClass('custom-dialog');
}
</script>
</ui:define>
Code: Select all
@media ( min-width : 960px) {
.custom-dialog.ui-dialog {
width: 70% !important;
}
}
@media ( min-width : 0px) and (max-width: 960px) {
.custom-dialog.ui-dialog {
width: 100% !important;
}
}
.custom-dialog.ui-widget-overlay {
background: #000000 none repeat scroll 0 0 !important;
opacity: 1.0 !important;
}
.custom-dialog.ui-dialog .ui-dialog-content {
padding: 0px !important;
font-size: 0;
}