473,387 Members | 1,431 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,387 software developers and data experts.

what caused onresize event behavior to change?

Hi!

I have recently realized that some computer in my office have a
different behavior when it comes to handle the onresize event in
Internet explorer. I red a lot on this forum about this but I never was
able to understand what is the cause of the different behavior. That's
what I want to know.

my HTML code:
-----------------
<html>
<head>
</head>
<body onresize="alert()">
</body>
</html>
-----------------

a very simple code like this generate two very different behavior in
IE.

#1 - Most of the computer will do an alert as soon as I resize the
window for a single pixel.

#2 - the alert occurs at the end of the resizing when I release the
mouse button.
Anybody know what I can modify in my computer to have every copmuter
react as #1 situation??

Hint: I saw this problem on winxp sp2, win2000, win98. IE version
doesn't seems to make a difference. I tried to compare the windows
update... without success!
:(

Thanks for your help!

Jeje

Jul 23 '05 #1
5 5893
VK
It is very strange that it work(ed) for you however whatsoever, because
it shouldn't.

Consider the small test case at the bottom. The comments are following:
1) Firefox fires 'onload' AFTER you ended up with resizing. It has
sense, because not any resize is really resize: what if you returned
the window to the exactly same size as before dragging? Take the resize
event on the capturing phase (while it's going down), and you are sort
of ok. BUT SEE THE POINT 3 !

2) IE 6.0 is badly broken. It generates from 2 up to 4 resize events AT
THE BEGINNING of each drag, depending from what side are you dragging
(it must be correlated to the scrollbars redraw, which causes separate
resize bubbles). Also it fails to set event properties (all undefined),
so you cannot trace bubbles history.

3) A huge lot of things may cause onresize event, including first page
load. So using this method you can easily fail in a dead loop, then one
onresize will cause another etc. etc. You should use real size check:

on init:
self.oldWidth = self.innerWidth
self.oldHeight=...

and later if self.oldWidth != self.innerWidth etc.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script>
var isDOM = window.addEventListener;
function init() {
if (isDOM) {
self.addEventListener('resize',test,true);
}
else {
self.attachEvent('onresize',test);
}
}

function test(e) {
var tmp = '';
if (isDOM) {
alert(e.target);
}
else {
for (prop in event) {tmp+=prop+'='+event.prop+'\n';}
alert(tmp);
}
}

window.onload=init;
</script>
</head>

<body bgcolor="#FFFFFF">

<p>Text</p>
</body>
</html

Jul 23 '05 #2
On 19 May 2005 14:47:08 -0700, je****@hotmail.com wrote:
a very simple code like this generate two very different behavior in
IE.

#1 - Most of the computer will do an alert as soon as I resize the
window for a single pixel.

#2 - the alert occurs at the end of the resizing when I release the
mouse button.
Anybody know what I can modify in my computer to have every copmuter
react as #1 situation??


change the "show window contents whilst dragging" setting in your
window manager.

Jim.
Jul 23 '05 #3
VK
Just knocked on me:

"event properties for onresize are not set" might be not a bug, but a
security mesure. Otherwise we could bypass frame security model by
using event.srcElement.doWhatYouWant()

Jul 23 '05 #4
Thanks for your help everybody!

VK:
My problem only concern IE 6 + on a window OS because I'm making a
software based on this technology (poor me! :)
My question is not how to go around the problem in an html page, but
what windows update, registry key, or whatever windows settings can be
turn ON/OFF to enabled or disabled this "feature".

Jim Ley:
Thats the kind of answer I was expecting. I hope what you say is true,
Unfortunatly I'm going to have to wait until tuesday to test this.

Here's what I found on this topic:

-------------------------------------------------------------
Showing window contents whilst dragging

This tweak turns on the option to show the full window contents (rather
than just an outline) of a window whilst it is being dragged to a new
position.
To show window contents whilst dragging:

Use a registry editing tool to navigate to the following key:
HKEY_CURRENT_USER\Control Panel\Desktop
Insert or change a value with the following details:
Data Type: SZ
Value Name: DragFullWindows
Value: 1
Restart the computer for the changes to take effect.
Please note: This functionality is automatically turned off by some
third-party applications
-------------------------------------------------------------
found on:
http://www.sanx.org/tipShow.asp?articleRef=143

Many thanks to everybody, I'm going to confirm soon if that is the
solution!

Jeje

Jul 23 '05 #5
Confirmation!

the solution:

the registry key that turn that feature ON/OFF

HKEY_CURRENT_USER\Control Panel\Desktop\DragFullWindows

1=ON (will display the content while the window is moved or resized)
0=OFF(will not)

It seems this feature have an effect on the onresize event of an HTML
page.

Thanks again!

Jul 23 '05 #6

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

Similar topics

6
by: The Plankmeister | last post by:
Hi... Is there a way of preventing the second firing of the onResize event in IE? It's an absolute bast. In the past few weeks I've come to realise how completely and utterly pants IE is. Shame...
2
by: Bas | last post by:
Hello all, I'm trying to create a little script which will save the width of a certain frame into a database, so that every user still has his/her "own" frame width when logging back on. Now,...
4
by: Ike | last post by:
Does javascript have on onresize() method? How can you implement that? Is it possible to cause things to repaint when resized? Thanks, Ike
4
by: me54 | last post by:
does anyone know how to call some javascript function when firefox fire the onresize event? something like <body onresize="alert();"> doesn't work on forefox? thnx.
6
by: hannibal | last post by:
Hi, i need to refresh page cathcing "onResize" event. I wrote this code: <body onResize="javascript:winodw.location.reload(true); return true;"> On I.E. it works, but it doesn't work on...
9
by: Joe | last post by:
I have a DataGrid with a templated column that displays ImageButtons. I need to know if one of these buttons caused the postback or just another button on the form. If one of these buttons caused...
2
by: Tony | last post by:
If I want to call a function (call it doResize) when the browser window is resized, is it better to put that in the body tag: <body onresize="doResize()"> Or is it better to put the call in a...
2
by: FrankIsHere | last post by:
This should attach the event to the onresize of the window object, but when I try to resize the browser after executing the page it does not work... only after I refresh the page. But then of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
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...

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.