Forum Moderators: coopster

Message Too Old, No Replies

Highlight certain items on a page depending on incoming link

         

genesisone

10:16 pm on Feb 21, 2004 (gmt 0)

10+ Year Member



There has been a discussion in the CSS group about highlighting certain
items on a Web page depending on incoming links to anchors. You can find
the thread at:

[webmasterworld.com...]

A PHP solution to the challenge was eventually developed by participants
that suited the original poster's needs brilliantly. My needs are somewhat
similar. I have a page of links (something like a big site map) several
times larger than the advert page at the center of the thread above (it
cannot be split into smaller pages). In pure HTML, the page needs to load
into a browser cache only once, and from then on any number of external
calls for jumps to various anchors can be accomplished without the need to
completely reload the page again. Like the original poster, I would like
the anchored text (or in my case, the anchored links) to be highlighted
after a jump. However, it's my understanding that this PHP script causes
the entire HTML part of the page to be reloaded (or rebuilt) each time a
new anchor is called. I think this would be very slow in my case and
probably unfair to my visitors (especially those with slower modems). Can a
script like this be designed to move the highlight around in such a way
that the whole page does not have to be reloaded (or rebuilt) each time a
different anchor is called?

BTW, I'm a newcomer to PHP, so please forgive me if I have misunderstood
something in the referenced script, or if I am unintentionally asking for
the impossible. Thanks!

twist

9:16 am on Feb 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



After re-reading your post I think I understand what you are wanting to do. I don't know of any way to accomplish this in php. My only suggestion might be to try a javascript solution. This would allow the page to stay unmodified so it would be cached.

Pass a variable with the anchor link and let javascript decide which area to highlight. Sorry I couldn't be of more help.

genesisone

7:19 pm on Mar 26, 2004 (gmt 0)

10+ Year Member



For anyone encountering this topic in the future, I took Twist's advice and located JavaScript code that will highlight certain items on a page as described above. I have given it a fair trial on my Web pages and find that it works wonderfully. You can find the script by searching Google for the terms "Fragment Highlight Javascript."