473,626 Members | 3,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.get ElementById("pa rent_for_video" ).style.display !=
"none") {
calculate_posit ions();

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

main_div = document.getEle mentById("main_ div");
main_div.style. height = video_overlay_h eight;
main_div.style. width = video_overlay_w idth;
main_div.style. top = video_overlay_t op;
main_div.style. right = video_overlay_r ight;
}//if(document.get ElementById("pa rent_for_video" ).style.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 17505
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.javas cript 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
1688
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" && s_width == "640" ) {
2
1849
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 either a full size image or an image with supporting detail. It's the same idea used on lots of Web sites that show thumbnails where you click on one and the full-size image is displayed in a new window. However, I have different-sized images that will...
0
1074
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 that the Properties window, Watch 1 window and Call Stack window will not popup when I put the mouse cursor over its tab or click on the tab. To get the window to popup I need to move the cursor over any other tab, when that window pops up I slide...
20
7903
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 mouseup event outside the document? Also, how can I get the relative coordinates of the cursor while it is outside the browser? Thank you.
6
5631
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 window when I open a new window. > > function expand() { > window.moveTo(0,0); > window.resizeTo(screen.availWidth, screen.availHeight); > }
4
6393
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 to look a and I am loosing tremendious amounts of time trying to organize it so that I could view it. Regards, Alexandre Brisebois
5
6406
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 "...", instead of the text wrapping. What is the best way I can detect whether the line wrapped, and how many characters to cut off at the end? - Jason
0
8711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8642
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8368
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7203
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4206
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2630
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.