Solved

onresize with frames

Posted on 2004-04-10
5
1,268 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
Comment Utility
Where did you keep this code?
In a frame or in html file containing frameset?
0
 

Author Comment

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

Expert Comment

by:venkateshwarr
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

744 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

19 Experts available now in Live!

Get 1:1 Help Now