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

N

Norman Fritag

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
 
T

Thomas 'PointedEars' Lahn

Norman said:
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;
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top