You are here: Re: link hover color not honored when using onclick event « HTML « IT news, forums, messages
Re: link hover color not honored when using onclick event

Posted by Richard Thoms on 11/29/51 11:33

Mitja Trampus wrote:
> Richard Thoms wrote:
>
>> Mark Parnell wrote:
>>
>>> In our last episode, Richard Thoms <rdthoms@bellsouth.net> pronounced to
>>> alt.html:
>>>
>>>> The second link has no href in it (is that legal?)
>
> >>> /.../ [:hover does not work]
>
>>> That's because without a href attribute it's not a link. It's just an
>>> anchor.
>>
>>
>> I think this is the key to the problem. No href means no link, just
>> an anchor. I develop using firefox and everthing looked great there
>> but then when I test with IE I got unexpected results. Perhaps it is
>> firefox which has a bug and is letting this sneak through.
>
>
> Nono, check the specs, it's IE that's rusty.

I should have known better. IE correct, FireFox wrong, what was I thinking?

> The solution to your problem is to use something along the lines of
> <a
> href="foo.html"
> onclick="window.open('foo.html'); return false"
> >
> instead of just
> <a onclick="window.open('foo.html')">
>
> This solves your problem (a is now a "proper" link and IE will support
> :hover on it) as well as another one: your current solution does not
> work for users without JS, whereas the one with href does.

That did it!

Thanks for the help.

> WRT popup-blockers: No, they're smart enough not to block popups
> triggered by onclick events, so I wouldn't worry about that.
> What I'd consider more is whether a popup is perhaps still more of a
> nuisance to the user than an elegant solution.

Good to know. I'll consider go/no-go for pop-up but I think in this
application pop-up is the way to go. The visitor is on a web-page.
They click "email this page to a friend" a small POP-UP comes up to
enter email to/from info and a little message (all the while they can
still see the page they are referring to). Click send and the pop-up
goes away and they are right back where they started.

Thanks to all. I'll consider this issue closed!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация