473,503 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing color of hyperlinks?



[ This is my second attempt to post this; sorry for repeats. ]

Suppose I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly setting
this color, of course). How can I specify it?

Thanks,

Karl
~
--
Sent from a spam-bucket account; I check it once in a blue moon. If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.
Jul 20 '05 #1
5 1782

"KKramsch" <ka*******************@yahooPERIODcom.invalid> wrote in message
news:cc**********@reader2.panix.com...


[ This is my second attempt to post this; sorry for repeats. ]

Suppose I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly setting
this color, of course). How can I specify it?


With client-side script.

Jul 20 '05 #2
In <2l************@uni-berlin.de> "Harlan Messinger" <h.*********@comcast.net> writes:
"KKramsch" <ka*******************@yahooPERIODcom.invalid> wrote in message
news:cc**********@reader2.panix.com...


[ This is my second attempt to post this; sorry for repeats. ]

Suppose I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly setting
this color, of course). How can I specify it?
With client-side script.

How??? After scanning all the properties of links (including
"style"), not a single one reveals color.

Karl

--
Sent from a spam-bucket account; I check it once in a blue moon. If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.
Jul 20 '05 #3

"KKramsch" <ka*******************@yahooPERIODcom.invalid> wrote in message
news:cc**********@reader2.panix.com...
In <2l************@uni-berlin.de> "Harlan Messinger" <h.*********@comcast.net> writes:
"KKramsch" <ka*******************@yahooPERIODcom.invalid> wrote in messagenews:cc**********@reader2.panix.com...


[ This is my second attempt to post this; sorry for repeats. ]

Suppose I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly setting
this color, of course). How can I specify it?

With client-side script.

How??? After scanning all the properties of links (including
"style"), not a single one reveals color.


On second thought, I'm not sure. I was thinking you'd have a link with an ID
attribute, and use that to get its color, but of course you have no control
over whether that link has been visited or not.

Jul 20 '05 #4
"Harlan Messinger" <h.*********@comcast.net> wrote:
"KKramsch" <ka*******************@yahooPERIODcom.invalid> wrote:
"Harlan Messinger" <h.*********@comcast.net> writes:
>"KKramsch" <ka*******************@yahooPERIODcom.invalid> wrote:
>>
>> Suppose I want to set some color to match the color of (unvisited)
>> hyperlinks, whatever this color may be (without explicitly setting
>> this color, of course). How can I specify it?

>With client-side script.


How??? After scanning all the properties of links (including
"style"), not a single one reveals color.


On second thought, I'm not sure. I was thinking you'd have a link with an ID
attribute, and use that to get its color, but of course you have no control
over whether that link has been visited or not.


document.linkColor has been a part of the DOM since before the term
DOM was coined (it dates back to Netscape 2 JavaScript).

It will return the unvisited link colour for the document - tests in
IE6 show that it returns the link colour set via <body link="#rrggbb">
or if that isn't set then it returns the browser's default link
colour. It does not return link colours set via author CSS. I doubt it
returns link colours set via user CSS.

So that's a partial solution. In addition you would want to query the
styleSheets[] collection and its styleSheet compoments and find any
the :link definitions. Whilst I believe this can be done I haven't got
the code written already (yeah I'm lazy) and determinging which of
many :link styles is relevant to your goal may be a difficult taks in
itself.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #5
KKramsch wrote:
"Harlan Messinger" writes:
"KKramsch" wrote...
I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly
setting this color, of course). How can I specify it?

With client-side script.


How???


I think that's what the DOM getComputedStyle is for. I couldn't find
anything at the w3c on a quick Google search, but I did find a Mozilla
page on it:

http://www.mozilla.org/docs/dom/domr...es.html#998756

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1579
by: JP SIngh | last post by:
Hi All We have an ASP application which links to various word and excel documents stored in a folder called attachments. The documents are extermely confidential in nature and we would like...
20
13777
by: Bob | last post by:
Hello, I have an <h1> banner that is white font on black background. I am using CSS to style the banner in white on black. I would like to hyperlink the words, but I want to force the...
0
466
by: Tim | last post by:
Access 97: I have a table with a hyperlink field that I display on a form. I can click on the form field and the hyperlink activates correctly. However, if I try to activate the hyperlink using VB...
1
2359
by: Robin | last post by:
Hello! I'm having trouble with links and hyperlinks in MS Access 2003 - any help would be great! Question 1! The "insert hyperlink" icon opens a browser window, allows the user to browse...
3
1439
by: Gerhard | last post by:
I have an application that needs to be able to upload documents that can latter be accessed and opened by a hyperlink. I can do this easliy if I store the files in a subdirectory in the...
1
1257
by: Info_Junkie | last post by:
I access the group through Google Groups. I know how many hate that. Even so I like it, as our ISP account has bad customer service and we cannot get the setup thru Outlook Express to work to...
1
3630
by: Janna | last post by:
Hello tech savvy gurus! I hope someone can help me! THE PROBLEM: "Cannot open specified file" when I click on a hyperlink in an Access database when it is located on our server. THE...
1
1921
by: mforema | last post by:
Hi Everybody, I have an Access table with a field filled with outdated hyperlinks. I also have an excel spreadsheet that is the master list for these hyperlinks. The spreadsheet will be updated...
7
1122
by: Neekos | last post by:
I have an internal web page for my company that has a list of hyperlinks so that users can access different reports (.xls files on the server). What i would like to do is to keep track of who is...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.