You are here: onClick() on an anchor that doesn't force the page to jump to the top? « HTML « IT news, forums, messages
onClick() on an anchor that doesn't force the page to jump to the top?

Posted by Aaron Freeman on 10/06/68 11:42

I have a javascript swap image funciton that's called when a user clicks
on an image wrapped by an anchor. The anchor points to "#", but the
problem is that the image is below the fold, and when the user clicks
on the image, the image swaps but the page links to "#" and scrolls the
page to the top.

So it looks like:

<a href="#" onClick="function()"><img src="image.gif"></a>

If I place the onClick on the image itself, the swap will work without
jumping the page, but the cursor won't change to indicate a "hot" image.

Is there an easy solution here?

Thanks!

 

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

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