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

Problem getting onresize to work

I'm having a problem getting the window.onresize to work properly. Here
is a simple test case I wrote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test window.onresize</title>
<script type="text/javascript">
function resize_func() {
alert ('resize_func has been called');
}
window.onresize = resize_func();
</script>
</head>
<body>
<p>Just Some Text</p>
</body>

When I load this page in firefox (1.0.6). I get the alert box that pops
up on initial load, but any subsequent resizing of the window fails to
trigger the event. It's probably something really simple, but so far
I'm stumped. Any help would be greatly appreciated. Thanks
--
Darrel
Oct 12 '05 #1
1 2711
Lee
Darrel Yurychuk said:

I'm having a problem getting the window.onresize to work properly. Here
is a simple test case I wrote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test window.onresize</title>
<script type="text/javascript">
function resize_func() {
alert ('resize_func has been called');
}
window.onresize = resize_func();


That last line executes resize_func() and assigns the return value
(void, in this case) to window.onresize. If you want to assign a
reference to your function to window.onresize, leave off the parentheses:

window.onresize=resize_func;

Oct 12 '05 #2

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

Similar topics

2
by: David | last post by:
Greetings, Does anyone know of a workaround for the onresize bug in Firefox? <body onresize="history.go(0)"> I've looked all around and can't seem to find a working workaround. David
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.
36
by: Simon Wigzell | last post by:
I have the following in my webpage: <body onresize=CenterIt(); onMouseMove=mouseCheck(event);> CenterIt and mouseCheck are my own javascript functions. Works fine for IE and Opera, doesn't...
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...
2
by: jnm | last post by:
I have an old java script which places an arrow.gif in the lower right hand corner of the screen at all times regardless of scrolling and / or resizing the screen. The arrow is a hot spot, which...
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...
8
by: David Gravereaux | last post by:
Hi, I'm using chunked transfer-coding to send an "unending" page, but IE _NEVER_ fires onresize events until the page is finished. Unfortunately, the page never is "finished". How do I handle...
5
by: iKiLL | last post by:
Hi All i am developing a Windows Mobile User Controll and i need to make sure that it is not sized to small. i am developing in C# with CF2 for Windows Mobile 5. How is this done? i am...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.