I'm just learning Javascript and jQuery, but I'm an HTML'r trying to take the next step..
I'm attempting to drop content into a table, which can be any size at all (It's for a news site). I check for size and then resize the popup accordingly; while the window isn't exactly right it works, but in Firefox it's not even resizing.
Using a generic link to pop-open a basic window:
<a onclick="window.open('http://site.local/popup/','popup','width=1,height=1')">popup</a>
I'm pointing it to a default page where the cms is placing all content into a table (id="top"). It has a default width="1" to force a constraint, and then letting the content expand the table to set the real size. I then check the table size to see and resize the window on document.ready():
<script type="text/javascript">
<!--
$(document).ready(function() {
var divh = document.getElementById('top').offsetHeight;
var divw = document.getElementById('top').offsetWidth;
//Test size
//alert("Table: width= " + divw + "px / height= " + divh +"px");
//Resize
window.resizeTo(divw,divh);
}
-->
</script>
I need to be able to resize a window already opened in Firefox.
All the window sizes (except Firefox) are off but I can pad them - a little larger is better than cut-off. Firefox, unfortunately, generates a tiny 180w x 249h window and never resizes.
I've searched here unsuccessfully - most suggest editing a setting in firefox, which I clearly can't expect users to do.
Any ideas?
We have already mentioned a configuration setting in Firefox to resize popups. In short: Users need to set the parameter dom. disable_window_open_feature. resizable to true for this in Firefox's advanced configuration window.
To make a pop-up automatically grow according to its contents, set the AutoResize property from the Popup_Editor to True . This JavaScript snippet defines a function **PopupEditor_ForceResize()** that you will use to shrink the pop-up window during runtime.
I would highly recommend replacing your popup with a div popup. You're going to run into issues like you have with Firefox, and browsers blocking it altogether. Assuming you have jqueryui included and you're loading this content from the same domain:
$('#container').load('/popup',function() {
var table = $('#container #top');
$('#container').dialog({height:table.height(), width: table.width()});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With