Click to See Complete Forum and Search --> : How to force links to my pages to open in a frameset (not cover whole screen)?


Pelle
09-27-2005, 04:21 AM
I have a frameset with two frames called left and right. The left frame should always contain a hierarchical menu and the right frame will contain the real content.

The problem is that when someone links externally (not from my own URLs) to one of my URLs (my content) this link will open and cover the whole screen and not only the right frame in the frameset as supposed. I want the whole frameset to open with the content in the right frame and the menu in the left frame when an external link is clicked. Otherwise a visitor will not be able to choose from the menu alternatives that I have.

Is there anyway I can force this to happen?

KDLA
09-27-2005, 07:28 AM
The only way to do that is to provide them with a link to your frameset, rather than having them add you to their favorites or right-click to save your address. You can do this by setting up with a javascript button:

<script LANGUAGE="JavaScript">

<!-- Begin
function addbookmark()
{
bookmarkurl="http://file.htm"
bookmarktitle="Page Title"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
// End -->
</script>

The bookmark url needs to be the frameset document.

Then the link:
<a href="javascript:addbookmark()">Bookmark this</a>

You might reconsider the usage of frames - they're not user-friendly.

KDLA

Fang
09-27-2005, 07:58 AM
See how PPK does it: http://www.quirksmode.org/js/framecustom.html