|
-
Aug 11th, 2001, 06:34 PM
#1
Thread Starter
Lively Member
JAVASCRPIT - position a page in the middle of the frame
Here is what I have:
The window.htm contains this code:
<HTML>
<HEAD>
</head>
<frameset rows="100%,0">
<frame name="Top" src="Frame1.htm">
<frame name="Bottom" src="about:blank">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</noframes>
</frameset>
This window as you can see contains two frames. Frame1.htm contains:
<SCRIPT language=JavaScript>
function showFrame() {
window.parent.document.all.tags("Frameset")(0).rows = "30%,70%";
}
function hideFrame() {
top.document.all.tags("Frameset")(0).rows = "100%,0";
}
function ProjectFrame() {
top.frames(1).location.href = "http://Test/Proj1/Project1.htm"
}
Those are my two javascript functions. Here is the code where I call the function ShowFrame and ProjectFrame:
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
function ctrlInp_Click(txtParam)
{
var X = txtParam;
ResetValues();
if (X == "Hello")
{
showFrame();
ProjectFrame();
}
If the value in my activex control is = Hello then Showthe bottom frame and display the page in it with Project1.htm
At this Point I want Frame1.htm to display its document at the middle of the frame
Hopefully this will give you better a look at what I am trying to do...
-
Aug 12th, 2001, 08:17 AM
#2
so the <a name=hello> still applies.
Code:
top.frames(1).location.href = "http://Test/Proj1/Project1.htm#hello
then in your project1.htm file. you would put <a name=hello> where ever you want it to be. if you put this in the begining of the page it would start there, but if you put it in the middle it would start in the middle. do you understand now??
-
Aug 12th, 2001, 07:06 PM
#3
Thread Starter
Lively Member
Thank you for your pateince and assistance!
-
Aug 12th, 2001, 07:44 PM
#4
no prob, let me know if that works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|