By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,487 Members | 1,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,487 IT Pros & Developers. It's quick & easy.

hover

P: n/a

I'm new to CSS. I have seen hover used with anchor elements to chang
the text color but can it be used with any other elements? Are ther
any other simple alternate methods of changing text color without th
use of images (like with onMouseover/onMouseout)

domece
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message46697.htm

Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
domeceo wrote:
I'm new to CSS. I have seen hover used with anchor elements to change
the text color but can it be used with any other elements?
Yes, but it doesn't work in IE.
Are there any other simple alternate methods of changing text color
without the use of images (like with onMouseover/onMouseout)?
You can access CSS properties via objRef.style.propertyName (converting
two-part properties to camelCase), or change the class wtih
objRef.className.
Posted via http://www.forum4designers.com


- Ugly and large sig
- non-standard sig seperator
- adverts on the pages

Try either a less evil Web-Usenet gateway: http://groups.google.com/
Or get a real NNTP account.

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #2

P: n/a
Maybe stick it in a table, and give the table cell an id, and then have
a mouseover on the table cell change the bgcolor. Example follows. Question
to throw out there - is getElementById() an IE only thing? I have to admit,
I'm pretty green with the Javascript, and have only had call to write for IE
so far, and so haven't concerned myself too much with cross browser stuff.

<script>

function chBgcolor() {
document.getElementById("link1").bgColor = "FFFFFF";
return true;
}

</script>
[html]
<tr>
<td id="link1" onmouseover="chBgcolor();"><a href="link">link
text</a></td>
</tr>
"domeceo" <do************@mail.forum4designers.com> wrote in message
news:do************@mail.forum4designers.com...

I'm new to CSS. I have seen hover used with anchor elements to change
the text color but can it be used with any other elements? Are there
any other simple alternate methods of changing text color without the
use of images (like with onMouseover/onMouseout)?
domeceo
------------------------------------------------------------------------
Posted via http://www.forum4designers.com
------------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message46697.html

Jul 20 '05 #3

P: n/a
"fenian" <fe****@start.ca> wrote:
"domeceo" <do************@mail.forum4designers.com> wrote in message
news:do************@mail.forum4designers.com...

I'm new to CSS. I have seen hover used with anchor elements to change
the text color but can it be used with any other elements? Are there
any other simple alternate methods of changing text color without the
use of images (like with onMouseover/onMouseout)?

Top posting fixed, please don't.
Maybe stick it in a table, and give the table cell an id, and then have
a mouseover on the table cell change the bgcolor.
Why does it need to be in a table?

Using .style.backgroundColor rather than .bgcolor it will work for any
element.
Question
to throw out there - is getElementById() an IE only thing?


No. It's part of the W3C DOM and is supported by IE5+, Gecko, Opera
and others. The IE only 'equivalent' is document.all

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 #4

P: n/a
http://www.xs4all.nl/~peterned/csshover.html

Try this...

Steve Pugh wrote:
"fenian" <fe****@start.ca> wrote:
"domeceo" <do************@mail.forum4designers.com> wrote in message
news:do************@mail.forum4designers.com.. .
I'm new to CSS. I have seen hover used with anchor elements to change
the text color but can it be used with any other elements? Are there
any other simple alternate methods of changing text color without the
use of images (like with onMouseover/onMouseout)?

Top posting fixed, please don't.

Maybe stick it in a table, and give the table cell an id, and then have
a mouseover on the table cell change the bgcolor.

Why does it need to be in a table?

Using .style.backgroundColor rather than .bgcolor it will work for any
element.

Question
to throw out there - is getElementById() an IE only thing?

No. It's part of the W3C DOM and is supported by IE5+, Gecko, Opera
and others. The IE only 'equivalent' is document.all

Steve

Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.