Solved

onresize with frames

Posted on 2004-04-10
5
1,271 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

815 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now