Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Whole Win.moves when bookmark is clicked
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Whole Win.moves when bookmark is clicked

 Post Reply Post Reply
Author
vshriniwasan View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2001
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote vshriniwasan Quote  Post ReplyReply Direct Link To This Post Topic: Whole Win.moves when bookmark is clicked
    Posted: 09 December 2004 at 11:04pm
I have a simple Page. I have an iframe in the page. I frame is long and can span up three pages.
 
I have book marks set in the page. From the top page I use javascript to point to bookmarks inside the iframe which works without any problems.
 
When I click the book marks inside the iframe more times than ever it moves the Parent window little bit down.
 
Hope I am making sence. Is there any way to solve this problem?
 
Thanks,
Shrini


Edited by vshriniwasan - 10 December 2004 at 6:23am
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2004 at 7:38pm
can you post a url?

Lead me not into temptation... I know the short cut, follow me.
Back to Top
vshriniwasan View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2001
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote vshriniwasan Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2004 at 12:16pm
It is an internal site. Here is an example of the code.
 
Create two files (top.htm, test.htm) both in same location. Copy the source into the file.
 
top.htm
<input type="button" value="clickme" onclick="document.testFrame.location='test.htm#here';" />
<table>
  <tr valign="top">
    <td><div style="height: 1800px;"></div></td>
    <td><iframe name="testFrame" width="300" height="300" src="test.htm"></iframe>
    </td>
  </tr>
</table>
 
test.htm
<div style="height: 800px;"></div>
<a name="here"></a>
 
Thanks for all the help,
Shrini
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2004 at 1:00pm
Stnadard behavior for most browsers is to go to an anchor by re-positioning it as close to the top of the page as possible which also means positioning any container - like an iframe - it's in as close to the top as possible.
 
To get the effect you want, set up each anchor secction as separate pages and use your button onclick event to load a new page in the iframe - it won't reposition the container page.
 
Try something like:
 
top.htm
<input type="button" value="clickme" onclick="document.testFrame.location='testpage2.htm';" />
<table>
  <tr valign="top">
    <td><iframe name="testFrame" width="300" height="300" src="testpage1.htm"></iframe>
    </td>
  </tr>
 
testpage1.htm
<div>Page 1 here</div>
 
testpage2.htm
<div>Page 2 here</div>


Edited by dpyers - 11 December 2004 at 1:03pm

Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.