Faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

18 of 47 people (38%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How do I resize DIV element in a browser on resizing window which will support for all browser?

Apr 8th, 2008 18:18
ha mo, Dave Clark, Mahesh Bhutkar,


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mahesh,
     Since you specify "all browsers," then the only technique left 
for accomplishing that task is to use either the window.setTimeout() 
or window.setInterval() methods to automatically drive your resizing 
function on a timer.  The reason is that not all browsers expose a 
DHTML event for detecting the resize of the browser window.
<body onload="window.setInterval('MyResizeFunction()', 200); return 
true;">
     The above will automatically invoke your resizing function five 
times per second.  This will allow your function to check the current 
dimensions of the window and resize your DIV block accordingly.
Take care,
Dave Clark
www.DaveClarkConsulting.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com