Abdul Basith

Abdul Basith

  • NA
  • 22
  • 8.1k

Is there anyn way to fix the size of a popup window to auto?

Feb 9 2016 1:50 AM
Currently I'm doing a project in which i needs to collect data from a user and need to generate a PDF based on the user entered data. Before generating the PDF, there should be an option to display the preview of the same PDF. so i used the below codes:
 
 
$("#btnPreview").click(function () {
var data = UserData();
model = data.modelnew;
FamilyArray = data.familynew;
$.ajax({
url: "/CareApplication/Create",
type: 'POST',
contentType: 'application/json',
async: false,
data: JSON.stringify({ model: model, Family: FamilyArray, flag: "1" }),
success: function (data) {
var myPos = { my: "center top", at: "center top+100", of: window };
var $dialog = $('<div style="overflow-y: hidden" ></div>')
.html('<iframe marginwidth="0" marginheight="0" frameborder"=0" src="' + data + '" width="100%" height="100%" ></iframe>')
.dialog({
autoOpen: false,
modal: true,
height:650,
width: 1200,
title: "Preview",
position: myPos,
});
$dialog.dialog('open');
}
});
window.scrollTo(0, 0);
});
 
 
 
 
 here i have fixed the size of the popup window(height:650, width:1200), due to this the size of the popup window varies for different browsers. So I cant close the popup window. my question is that Can i fix the size of the pop up window to automatic? This popup window should display on the same page.
 

Answers (1)