473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

detecting and acting on a window resize

Hey Guys

I am able to detect a window resize using the following code:

window.onresize = function () {
if(document.getElementById("parent_for_video").sty le.display !=
"none") {
calculate_positions();

//Resize the main div
gray_div = document.getElementById("gray_div");
gray_div.style.height = h;
gray_div.style.width = w;

main_div = document.getElementById("main_div");
main_div.style.height = video_overlay_height;
main_div.style.width = video_overlay_width;
main_div.style.top = video_overlay_top;
main_div.style.right = video_overlay_right;
}//if(document.getElementById("parent_for_video").sty le.display !=
"none")
}//window.onresize = function ()

You should be able to see that when a resize is detected i move and
resize a couple of divs.

The thing is though i cant work out how to do this in real time. That
is the calculations only happen when i let go out the mouse. So if i
resize from massive to small the changes dont get reflected untill i
stop dragging the mouse.

I'd like to be able to resize and stuff as the mouse is dragging the
dimensions.

Hope that makes sense and someone can help

Cheers

Andy

Oct 25 '06 #1
2 17483
daveyand said the following on 10/25/2006 12:11 PM:
Hey Guys

I am able to detect a window resize using the following code:
<snip>
The thing is though i cant work out how to do this in real time. That
is the calculations only happen when i let go out the mouse. So if i
resize from massive to small the changes dont get reflected untill i
stop dragging the mouse.
A while back, the browsers fired the onresize event every pixel it got
resized. Every time you moved 1 pixel, the event got fired. It got very
annoying if an alert was thrown up! Now, it has been changed where
onresize fires like onresizeend does in IE - after the browser has been
completely resized.
I'd like to be able to resize and stuff as the mouse is dragging the
dimensions.
You can't anymore.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 25 '06 #2
I'd like to be able to resize and stuff as the mouse is dragging the dimensions.
You can't anymore.
Damn.

Oh well. Thanks.

I guess i could always do a setTimeout() situation. But no point
really.

Oct 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Andy | last post by:
got the usual script: <script language="JavaScript" type="text/JavaScript"> var s_height = screen.Height var s_width = screen.Width var s_screen= screen.colorDepth if ( s_height == "480" &&...
2
by: Charles Packer | last post by:
From one of the online Javascript tutorials, I learned how to open a new window and set its size. I'm building a page that has several small photographs, and I want to let the viewer examine...
0
by: James | last post by:
I have a problem with the ide that, while I have a workaround, is still annoying. I have all the windows, help, properties, toolbox, call stack, watch, etc. set to auto-hide. There are times...
20
by: Mandy Memphis | last post by:
If I perform a mousedown within a document, move the mouse outside the browser window, and then release the mouse button, the document.onmouseup event does not fire. Is there any way to detect a...
6
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
5
by: Jason | last post by:
I have a div box with a border, and some padding left and right. It has some text with different font sizes, and a few icons. I want to cut off any overflow at the end of the line with "...",...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.