|
Posted by Neredbojias on 10/06/76 11:42
With neither quill nor qualm, Aaron Freeman quothed:
> 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?
Easy? How about right?
What if the proverbial user has javascript disabled? He should get
something, shouldn't he?
<a href="bigimage.gif"><img src="image.gif" alt=""></a>
Notice the 'alt=""'. It is required, and it's good if there's some
meaningful text between the quotes.
Now, if you want to do the swap thing (for whatever reason,) here is the
same line with the added inclusion.
<a href="bigimage.gif" onClick="function();return false;"><img
src="image.gif" alt=""></a>
--
Neredbojias
Contrary to popular belief, it is believable.
Navigation:
[Reply to this message]
|