Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visited Link and Pop-Ups

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I have a list of links - each which pops a window (href="#" onClick="pop.....")

I want to set a visited link color to these items but can not figure out how as they either all go visited once on is clicked or do not go at all...

Any thoughts?

[conehead]
 
If I understand you correctly, you just want to change the visited link's color. To do this, you will want to use CSS.

The code would look like:

a:visited {color:#ffffff;}

That line should either be in a .css file and included in your HTML for the page or in <STYLE></STYLE> tags in the HEAD tags of the HTML.
 
I understand wanting to pop a window, but to browsers with javascript disabled (like mine :) and about 10% of surfers) this link will simply not work.

to construct a backward compatible link, use

<a href=&quot;somepage.html&quot; onclick=&quot;Pop('somepage.html'); return(false);&quot;>

the advantage is that the a link references the actual page the browser will be visiting, so it will be able to detect if that link should be classed as visited or not. Using '#' as the link href will make it impossible for a browser to identify the link target, and so identify whether it should be considered visited or otherwise.

the 'return(false)' statement is important - it prevents the browser from following the link in addition to the javascript popping the window.

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
...or you could put
Code:
 <a href=&quot;javascript:Pop('somepage.html')&quot;>Pop-Up</a>
That'll be just like the onclick event only with out the # as the target...and I think if you change the somepage.html varible the links won't change color all at once
Hope that helps
Jammer1221
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top