I want the image in my modal dialog to be width:100%, but do not know how to do it.
I'm using this code (thank you Mohamed El-Qassas):
<script>
function openDialog(pageUrl) {
var options = {
url: pageUrl,
title: 'Image',
allowMaximize: false,
showClose: true,
width: 800,
height: 500
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
</script>
<a href="#" onclick="openDialog('http://url');"><img src="xxx.png"></a>
My 'openDialog' points to an URL and displays an image. My 'img src' is a thumbnail image.
All is working, but my image is too big for the modal size - I want the image to shrink-to-fit or to be of width:100%, no matter the real size of the image.