Solved

onresize with frames

Posted on 2004-04-10
5
1,272 Views
Last Modified: 2008-03-17
I have a document with 3 frames, and I need to run a function when the user resizes the window.  

Here is how I am handling the event:

<SCRIPT FOR="window" EVENT="onresize" LANGUAGE="JavaScript">
      doFunc();
</SCRIPT>

The problem is, when the window is resized, the function runs 3 times, once for each frame.  How can I get it to only run once?
0
Comment
Question by:scottarius
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10796444
Where did you keep this code?
In a frame or in html file containing frameset?
0
 

Author Comment

by:scottarius
ID: 10796517
it's in the head of the html file with the frameset.
0
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10796543
Why dont you move this code to one of the html file inside a frame...
0
 
LVL 25

Accepted Solution

by:
devic earned 250 total points
ID: 10796545
try this:
-----------------------
<script>
var resizeCaptured=false;
</script>
<SCRIPT FOR="window" EVENT="onresize" LANGUAGE="JavaScript">
if(!resizeCaptured)
{
    resizeCaptured=true;
      doFunc();
      setTimeout("resizeCaptured=false",1000)
}
</SCRIPT>
0
 

Author Comment

by:scottarius
ID: 10796562
perfect! thanks devic.

i was thinking i might have to set a timeout but wasn't sure the best way to go about it.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to print dynamic Google map and directions? 1 23
Hide cell in a table 2 26
html Uncheck Checkbox 2 25
jQuery force form POST 7 42
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question