Solved

Firefox and Chrome frame OnResize not working

Posted on 2012-03-26
3
1,328 Views
Last Modified: 2012-03-28
I am trying to capture when a frame is resized.  This works perfect in IE but not at all in Firefox or Chrome.  Everything I have read says it should work, so I must be doing something wrong.  Can anyone please help?

Code:

test.html
<html>
<frameset cols="*,*" border=15>
  <frame id=frmFrame src="frame.html" onload="alert('load');">
  <frame id=frmFrame2 src="frame2.html" onresize="alert('resize');">
</frameset>
</html>

frame.html
<html>
<body bgcolor=green>
&nbsp;
</body>
</html>

frame2.html
<html>
<body bgcolor=red>
&nbsp;
</body>
</html>
0
Comment
Question by:stuart100
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 37770503
Here

<frameset cols="*,*" border=15>
  <frame id=frmFrame src="..." onload="alert('load');">
  <frame id=frmFrame2 src="..." onload="var win = this.contentWindow?this.contentWindow:this;win.onresize=function(){parent.document.title = 'resized @'+new Date();}">
</frameset>
</html>

Open in new window

0
 

Author Comment

by:stuart100
ID: 37778880
Thank you for the solution, I am giving you the points.

Can you explain though your code.  I think what is going on is that Firefox is not correctly registering the onresize event to the frame or using the wrong container?  Is this correct?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37778889
Fx has a different Dom access than ie. it is now standard on new browsers
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
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)

809 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