I am trying to add an effect to a website a one of my content boxes will pop out to a new javascript popup window.
I have this code:
$('.dialog-toolbar .popout').on('click', function(){
javascript:void
window.open('dialogpop.php?cmd='+cmd, toolbar=0, menubar=0, location=0, status=1, scrollars=1, resizable=1, left=0, top=0);
return false;
});
the only problem is without width and height it comes up at the default window size. Is there a way to define it tell the popup window to size of its content?
Edit I'd like to avoid having to do something like this
$('.dialog-toolbar .popout').on('click', function(){
$('#hiddenDiv').load('dialogpop.php?cmd='+cmd, function(){
var dwidth = $(this).width();
var dheight = $(this).height();
javascript:void
window.open('dialogpop.php?cmd='+cmd,width=dwidth, height=dheight toolbar=0, menubar=0, location=0, status=1, scrollars=1, resizable=1, left=0, top=0);
return false;
});
});