Rollover Links
Can someone please explain how I can make a link change color and become underlined when the cursor is over it. I have been using the following which does not work.
<style type="text/css">
<!--
A:link { text-decoration: none; }
A:visited { text-decoration: none; }
A:hover {text-decoration:
underlined;color: black }
-->
</style>
Thanks,
AB
------------------
[QOUTE]"Never be afraid to try
something new. Remember,
amateurs built the Ark,
professionals built the
Titanic."[/QOUTE]
[QOUTE]"Never be afraid to try
something new. Remember,
amateurs built the Ark,
professionals built the
Titanic."[/QOUTE]
Bimjo posted this at 19:27 — 23rd February 2000.
They have: 81 posts
Joined: Feb 2000
I believe it's underline, not underlined.
Bimjo
AB Carroll posted this at 19:40 — 23rd February 2000.
They have: 16 posts
Joined: Nov 1999
Nope, that didn't change anything.
AB
AB Carroll posted this at 19:46 — 23rd February 2000.
They have: 16 posts
Joined: Nov 1999
Actually, I take that back. I did not change anything in NS, however in IE the underline now appears when the cursor is over the link but the color stays the same.
Any suggestions on how to make this work in NS, and also change the color?
Thx,
AB
[QOUTE]"Never be afraid to try
something new. Remember,
amateurs built the Ark,
professionals built the
Titanic."[/QOUTE]
Bimjo posted this at 21:48 — 23rd February 2000.
They have: 81 posts
Joined: Feb 2000
Ah, horse of a different color... NS doesn't support hover (until 5.0 comes out) so your only other option is to use Javascript to do it.
This may or not be worth the effort, depending on how much you need the hover in your design.
There may be something you can use at www.irt.org, but I haven't checked specifically for this.
Bimjo
***editied to correct the url***
[This message has been edited by Bimjo (edited 23 February 2000).]
Bimjo
Just my opinion, worth $0.00001 anywhere on earth.
======================
Bimjo's Corner
Suzanne posted this at 22:43 — 23rd February 2000.
She has: 5,507 posts
Joined: Feb 2000
About the color -- make sure you close the declaration with a semi-colon and try using the hex or rgb instead. I find the hex colours are the most supported, so use <b>color: #000000;</b> instead. Also, make sure the colours are set with the other tags as well, especially if you want the colour to change on hover.
Cheers,
Suzanne
------------------
Zero Cattle
Suzanne
Tables DeMystified
NSS posted this at 01:23 — 24th February 2000.
They have: 488 posts
Joined: Feb 2000
Hi,
Some tips when working with CSS code tags in Netscape browser.
1)<HR> Horizontal rules can be styled in IE, but not in Netscape.
............................................
Carroll, this is the answer to your question.
2)<A> Netscape treats styles on the anchor tag inconsistently, sometimes Netscape will act correctly the first time the page displays, but then "forget" the style if you come back to reload that page.
.............................................
3)<TABLE> tags works fine in IE, but behave strangely in Netscape. In Netscape when <TABLE> is styled, <TH, <TR> and <TD inherit just some of those styles(exp: BG works but not the FONT family). But if you try to style<TH>, <TR>, and <TD> indidually, and not style <TABLE>, then Netscape actually crashes(on both platforms). In other words, when mixing styles and tables.
The above was copied from the book:
Guide To Style Sheet by Steven Mulder.
Hope this helps,
NSS http://www.unitronics.com
[This message has been edited by NSS (edited 23 February 2000).]
[This message has been edited by NSS (edited 23 February 2000).]
cynsanity posted this at 00:22 — 25th February 2000.
They have: 5 posts
Joined: Feb 2000
if you want to have the working code for it then tell me... fortunately I found it out some time ago *g*
AB Carroll posted this at 00:28 — 25th February 2000.
They have: 16 posts
Joined: Nov 1999
yes, please.......
cynsanity posted this at 19:47 — 25th February 2000.
They have: 5 posts
Joined: Feb 2000
hi there...
ok here's the code I hope I made it correct... if it doesn't work please tell me, but I think it's okay... place it within the head tags...
<!-- Rollover Image Script -->
<script language="JavaScript" type="text/javascript">
<!--
function SwitchImg()
{ //start
var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
if ((store.indexOf('document.layers[')==0 && document.layers==null) | |
(store.indexOf('document.all[')==0 && document.all==null))
store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
obj = eval(store);
if (obj != null) {
switcher[keep++] = obj;
switcher[keep++] = (history==null | | history[keep-1]!=obj)?obj.src:history[keep];
obj.src = SwitchImg.arguments[rem+2];
} }
document.Data = switcher;
} //end
function RestoreImg()
{ //start
if (document.Data != null)
for (var rem=0; rem<(document.Data.length-1); rem+=2)
document.Data[rem].src=document.Data[rem+1];
} //end
//-->
</script>
<a href=".html" onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.name','document.name','direction of img2')"><img src="direction of the picture1" name="name" width="x" height="y" alt="" border="0"></a>
I hope it works... if it doesn't I'll email you the whole code with the pictures I used. Then it'll surely work
cynsanity posted this at 19:52 — 25th February 2000.
They have: 5 posts
Joined: Feb 2000
dammit I forgot something. Simply edit the linkname in Photoshop or whatever you're using in the way that it looks like you want to have it. Then store it, and paste it as img2. I always use Adobe Photoshop
AB Carroll posted this at 20:01 — 25th February 2000.
They have: 16 posts
Joined: Nov 1999
Thanks Cynsanity,
However, you gave me the script for moseover events - right? I was actually curious on how to make the "hover" code work in NS not just ofr IE. This code does not involve the use of images.
Thanks Though!
-AB
PS! PhotoShop rules!
[QOUTE]"Never be afraid to try
something new. Remember,
amateurs built the Ark,
professionals built the
Titanic."[/QOUTE]
Bob posted this at 21:04 — 25th February 2000.
They have: 117 posts
Joined: Feb 2000
Cynsanity,
I'd like to do something along the lines that AB Carrol is doing, but not quite the same. I have a table with six rows and a bgcolor of lightblue. The first column in each row is a link to another page in my site. What I'd like to do is to have the bgcolor of the entire row of the table change when the cursor is positioned over the link in the first column. I don't want to use image changes to do this (I already figured out how to do it by having each link be an img and doing rollovers on each img). i'd like to leave the table defined as it is, but change the bgcolor. I can change the bgcolor of the entire page using a onmouseover command, but can't figure out how to change the bgcolor of just a row in the table (or the whole table itself for that matter). Any ideas? Thanks in advance for any help.
Bob
Vincent Puglia posted this at 22:55 — 26th February 2000.
They have: 634 posts
Joined: Dec 1999
Hi Bob,
You may not like this -- as far as I know the following does not work for NN (and believe me I have tried.) because NS does not support changing bgColor in cells.
Essentially, you use dHTML and cell IDing
The following code is from an upcoming page at my site. So check there later in the week for a complete script.
<td id="cellB0"
onmouseover = "return swapColor('cellB0',true)"
onmouseout="return swapColor('cellB0',false)">English:</td>
<td id="cellB1"
onmouseover="swapColor('cellB1',true)"
onmouseout="swapColor('cellB1',false)">85</td>
<td id="cellB2">55</td>
function swapColor(cell, switchOn)
{
var source;
if (!isOk)
{
alert("Sorry this script works only with IE browsers.");
return
}
source = document.all[cell];
if (cell == "cellB1" && switchOn != true)
{
if (document.myForm.C1.checked) source.bgColor = document.myForm.C1.value;
else source.bgColor = document.bgColor;
}
else
{
if (switchOn == true) source.bgColor = '#66ff66';
else if (switchOn == false) source.bgColor = document.bgColor;
else source.bgColor = switchOn;
}
}
Vinny
------------------
GrassBlade: cut&paste javascript
Where the world once stood
the blades of grass cut me still
cynsanity posted this at 18:27 — 7th March 2000.
They have: 5 posts
Joined: Feb 2000
uuuhh... learned something
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.