Current location: Hot Scripts Forums » General Web Coding » JavaScript » Resize Frames with Javascript

Resize Frames with Javascript

Reply
  #1 (permalink)  
Old 07-01-09, 03:02 PM
amosmj amosmj is offline
Newbie Coder
 
Join Date: May 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Resize Frames with Javascript

I've been googling for days and found plenty of examples, none of them appear to work though.
Below are three windows of text that I've been using to test the idea: the first is the frameset, the second is the frame content, the third is the javascript. I'm testing on Firefox 3.
Can anyone tell me what it is that I am doing wrong?

FramesetPractice.html
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<frameset cols="50,50" rows="50,50" id="TestFrameset">
 <frame name="TopLeft" src="FramedPagePractice.html" />
 <frame name="TopRight"  src="FramedPagePractice.html"/>
 <frame name="BottomLeft"  src="FramedPagePractice.html"/>
 <frame name="BottomRight"  src="FramedPagePractice.html"/>
</frameset>
</html>
FramedPagePractice.html
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" language="javascript" src="FramesPractice.<acronym title="JavaScript"><acronym title="JavaScript">js</acronym></acronym>" ></script>
</head>
<body>
<form>
 <input type="text" name="DisplayText"/>
 <br />
 <input type="button" name="CommandButton" value="Click Me!" onClick="OnlyFunction()"/>
</form>

</body>
</html>
FramesPractice.<acronym title="JavaScript"><acronym title="JavaScript">js</acronym></acronym>
Code:
function OnlyFunction (){
 	alert(top.frames[0].name);
	top.getElementById("TestFrameset").rows = "20%,80%";

}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript and frames? warandchaos Script Requests 2 10-02-07 07:12 AM
Killing frames with Javascript? nova912 JavaScript 1 04-15-06 11:19 AM
Print Preview Javascript Frames!! jajalc JavaScript 2 10-25-05 04:28 AM
Reaaly stuck about javascript over frames muratisik JavaScript 1 12-14-03 12:58 PM
PLZ HLP! Sending Javascript between two frames. Caleb JavaScript 1 09-01-03 01:20 AM


All times are GMT -5. The time now is 09:11 PM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.