473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

query: colour changing text

alright there,
i'm pretty much throwing myself on everyone here's mercy, as i'm
struggling to even articulate what i mean, never mind create the
behaviour i want.

i've a website with a navigational frame on the bottom, and the main
site taking up the other 90% of the window. each page has got a
different background colour, where as the navigational frame obviously
stays the same.

is there a way that, when i click on one of the links in the
navigational frame, the colour of the text, still in this frame, would
change according to which link i click? from, for example, red, to
yellow or green depending on whether i choose 'pictures' or 'stories',
to match the colour scheme?

well, any help or anything much appreciated,
regards, mark.
Jul 20 '05 #1
1 1326
xtrmntr: a northern soul wrote:
i've a website with a navigational frame on the bottom,
That you should avoid, if possible:-)
navigational frame, the colour of the text, still in this frame, would
change according to which link i click?

<div id="navbar" onclick="foo(this, event)">
<a id="foo1" href="foo1.html" target="main">foo1</a>
<a id="foo2" href="foo2.html" target="main">foo2</a>
<a id="foo3" href="foo3.html" target="main">foo3</a>
</div>

<script type="text/javascript">
function foo(bar, evt){
var d=document, a, c, t;
var colors={
"foo1":"yellow",
"foo2":"green",
"foo3":"maroon"
};
if(bar && bar.getElementsByTagName &&
typeof bar.parentNode!="undefined"){

t=evt.srcElement||evt.target;
while(t.nodeType!=1)t=t.parentNode;
if(t && t.href){
a=bar.getElementsByTagName("a");
c=colors[t.id]||"black";
for(var ii=0; ii<a.length; ii++){
a[ii].style.color=c;
}
}

}
}
</script>
Jul 20 '05 #2

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

Similar topics

3
by: Aaron Whiffin | last post by:
Hi, I've set up the following table in MySQL 3.23.58 and all seemed to be working fine: CREATE TABLE advert ( id INT NOT NULL AUTO_INCREMENT, userid INT NOT NULL, make VARCHAR(25) NOT NULL,...
4
by: Dj Frenzy | last post by:
Hi, I know how to use javascript to change a background image to another background image, and how to change a background colour to another background colour. Is there a way to change an image to a...
4
by: Werner Partner | last post by:
I'm looking for something like that: http://www.sonoptikon.de/praxis-mt/test.php The text should have a certain indent, and from the left border should come a "marker" which goes over the text...
7
by: John | last post by:
hi, i have created a search form, and i want to search for a specific item in a field. e.g. i have a field called colour, which has record1 = 'red, blue, green' and another record2 = 'red' ...
3
by: KiwiBrian | last post by:
I have a text based and css controlled horizontal menu where on hover the text and "button/cell" background colour change. Fine so far, the background colour fills the button. However if one of...
2
by: John Pote | last post by:
Hello, I am new to CSS and come from an embedded/electronics background. Could some help with a question on colours and palettes using named colours rather than hex values (ie color: #aabbcc)....
2
by: feeman | last post by:
A while back I asked about changing the background colour of a text box according to the outcome of a tick box, and the code below was supplied which worked very well. Private Sub...
6
Sushi
by: Sushi | last post by:
Hello! I'm new to the Python language(about 2 months). Having done C programming for 2 years I find out I need Python for a final project, and have been trying to do get my head around object...
0
by: Gouri.Mahajan7 | last post by:
Hello, I want to change the font of the text in richtextbox without affecting the colour of text. I want some text to be printed in different colours. When I try to change the font of the text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.