By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,467 Members | 1,308 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,467 IT Pros & Developers. It's quick & easy.

How to syncronise pages (left,right) on a frame??

P: n/a
Hi there
I was wonder how I can synchronise left page ( title) of a frame with
relevant hypertext ( to be highlighted) on the right side??

Right side Page contains only a hieratical list of Hypertext shortcuts that
open the relevant contents Page on the right side.
Now when the User uses the navigation buttons pre. Next to navigate through
the pages I like the Hypertext shortcut on the right side of the frame to be
highlighted???
Can that be done??

Kind regards
Norman
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Norman Fritag wrote:
Right side Page contains only a hieratical list of Hypertext shortcuts that
open the relevant contents Page on the right side.
Now when the User uses the navigation buttons pre. Next to navigate through
the pages I like the Hypertext shortcut on the right side of the frame to be
highlighted???
Your `?' key is b0rken.
Can that be done??


Yes, if you but the navigation buttons as _non_-JavaScript _hyperlinks_ on
the page and, in contrast, client-side JavaScript is available. Quickhack:

<!-- in the left (navigation) _frame_ of the frame_set_ -->

<script type="text/javascript">

function highlightMe(sHRef)
{
if (parent.frames.length > 0)
{
var oFrame = parent.frames['rightFrameName'];
if (oFrame && o.Frame.document && oFrame.document.links)
{
var aLinks = oFrame.document.links;
for (var i = 0; i < aLinks.length; i++)
{
var oLink = aLinks[i];
if (oLink.href == sHRef
&& typeof oLink.tagName == "string"
&& oLink.tagName.toLowerCase() == "a"
&& typeof oLink.style != "undefined"
&& typeof oLink.style.backgroundColor != "undefined"
&& typeof oLink.style.color != "undefined")
{
oLink.style.backgroundColor = "..."; // set colors to highlight
oLink.style.color = "..."; // the hyperlink
}
else
{
oLink.style.backgroundColor = ""; // reset colors
oLink.style.color = ""; // to default
}
}
}
}
}

</script>

<a href="..." on...="highlightMe(this.href)">...</a>
Instead of changing the format of the hyperlink directly, you can also
change the CSS class of the hyperlink to one that formats it different
from default using the hyperlink's `className' property.
HTH

PointedEars
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.