Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Making button's borderColor equal to linkColor

Reply
Thread Tools

Making button's borderColor equal to linkColor

 
 
KKramsch
Guest
Posts: n/a
 
      07-13-2004



I want the border color of this button to be the same as
document.linkColor. How can I implement this?

My best solution has been to have the onload handler for the page
find the button and set its style.borderColor attribute to the
desired color. Is there a better way?

Many thanks in advance,

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.
 
Reply With Quote
 
 
 
 
Java script Dude
Guest
Posts: n/a
 
      07-14-2004
> My best solution has been to have the onload handler for the page
> find the button and set its style.borderColor attribute to the
> desired color. Is there a better way?


You can set buttons to use a css class say <input type=button
class=lcButton...

You can then dynamically change the style specified in javascript
onload of the document. I don't have the exact syntax for changing the
css style in front of me but I have seen others do it and I've done it
sometime in the past.

If you have many buttons on the page, this method would theoretically
be more efficient since you don't have to find all the buttons in the
DOM

Another method would be to detect the document.linkColor at the top of
the body (just after body tag) and use document.writes for your
buttons forcing in the inline style at that time. Not sure if
document.linkColor is initialized at that point though.

JsD
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Sharing: Equal upload speeds but un-equal download speeds =?Utf-8?B?TkpU?= Wireless Networking 3 09-15-2007 06:22 AM
mouseover changing bordercolor Eirik Eldorsen ASP .Net 2 07-08-2004 10:53 PM
bordercolor tag and w3c standerd Dark Angel HTML 1 04-14-2004 04:33 PM
bordercolor tag and w3c standers Dark Angel HTML 2 04-14-2004 12:29 PM
Netscape BorderColor="#FFFFFF" (White) Heath HTML 0 08-14-2003 09:42 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57