This script is typically best for pop-up windows where you want to display random images on request. It will allow browser window to auto-fit according to the image size.

Add this script into head section of web page:

<script language="javascript">
<!--
var i=0;
function resize() {
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+80-i);
  self.focus();
  self.moveTo(170,50);
}
//--></script>

We just wrote a function named as resize. Call this function in the body tag of the popup page.

<body onload="resize();">

This function will serve the purpose and on page load it will look for the image size and will resize the browser window according to the image size.

This script is for popup page at which image is placed. Call the popup page with no toolbar or menubar as decsribed below:

<a href="#" onClick="window.open('popup-page.html', '', 'toolbar=0,menubar=0,location=0,left=0,top=113,screenX=0,screenY=100,scrollbars=yes'); return false;">Launch popup</a>

Download Window Resize Script

Related Posts

, , ,

Leave a Review

Incoming Searches

Resizing Images Based On Browser Window Size, mootools resizeTo not accurate, JS size to browser window to fit flash, jquery resize popup to size of image, jquery resize popup fit to image, jquery auto resize popup, jCarousel window resize problem, jcarousel problem -lite window resize, javascript window resize font-size, javascript window open max size, javascript window open auto fit image size, javascript resize image browser window, javascript popup window autofit, javascript popup window auto resize, javascript popup autosize, javascript pop window resize, javascript image popup window autosize, one page website with auto resize to browser, yui resize autofit, pop up calendar onclick image, yui resizable max, YUI Image Auto resize, yui browser window size, wordpress auto window width, window auto resizeto, w3 schools browser resize on load, w3 school browser resizer, site that resize browser max, onload resize w3school, resize window autofit, resize hight acording to windiw size to a popup page, resize browser to size of picture, resize a window according to image size javascript, popup calendar based on country language in javascript, popup browser window image autoscale, popup autofits size, javascript for autosize browser to content, javascript auto resize fit image, BROWSER AUTOSIZE JAVASCRIPT:, autosize window to image dimensions, autosize center popup window, autosize a browser window, autoresize funtion adobe flash, autoresize flash, autofit windows js script, auto resize window popup 2010 script, auto resize window image popup, auto resize popup, auto resize flash movie with javascript, auto resize center picture image flash actionscript 2, auto resize browser window using css, auto fit pop up, auto fit image web page, adjust browser window to image size, browser image autoresize, cache:lKg4Yc58pTEJ:www webstylepress com/auto-resize-browser-window-to-image-size/ yui resize fit, code javascript for auto Resize the Browser Window, javascript auto fit windows size, javascript auto browser size, images autofit windows jquery, image slider autoresize javascript, how to autofit the image size to a browser in html, how do i pop window resize according to image size, function height browser toolbars menubar resize -resizable, flash that autofits window size?, Flash resize fit browser Maximum size, flash load image and resize to fill browser window?, flash image auto resize on browser width, flash html auto resize window, download javascript autoresize window, dojo resize slide, dojo resize image, css auto resize pop up, actionscript2 javascript window self resize