OnClick Event Question

S

Spank

Hello,

I have a thumbnail image with the onclick event. When clicked, a
larger pic is displayed via a javascript funtion. When browsing the
page, the client does not realize the image is clickable because the
arrow your mouse displays as you browse from page to page, does not
transform to the pointer--something that natuarally happens when you
hover over a hyperlink. How may I provide this functionality?

Thanks,
John
 
F

Fabian

Spank hu kiteb:
Hello,

I have a thumbnail image with the onclick event. When clicked, a
larger pic is displayed via a javascript funtion. When browsing the
page, the client does not realize the image is clickable because the
arrow your mouse displays as you browse from page to page, does not
transform to the pointer--something that natuarally happens when you
hover over a hyperlink. How may I provide this functionality?

Style sheets.

..blah { cursor: hand; }

The exact value of .blah will depend on your name/id attributes for your
images.
 
R

Randy Webb

Spank said:
Hello,

I have a thumbnail image with the onclick event. When clicked, a
larger pic is displayed via a javascript funtion. When browsing the
page, the client does not realize the image is clickable because the
arrow your mouse displays as you browse from page to page, does not
transform to the pointer--something that natuarally happens when you
hover over a hyperlink. How may I provide this functionality?

Thanks,
John

If you want it to act, look, and feel like a link, then make it a link.
 
N

nice.guy.nige

While the city slept said:
Randy,

I did something similar. If you want an image to have the "hand"
cursor you can use css to do it:

<style type="text/css">
img { cursor:pointer; }
</style>

First, it is the OP who is having the problem, not Randy.

Second, as Randy said, it should be a link. It currently acts like a link,
and your code will help it look like a link, so let's actually make it one
that will work alround...

<a href="mypic.jpg" onClick="myjsfunction('mypic.jpg'); return false;"><img
src="mythumbnail.jpg" width="100" height="100" alt="picture of something.
Links to full size version" title="This is a thumbnail. Click on it to open
the full size version in a pop-up window"></a>

.... If javascript is available to the user, and enabled, then this will open
the image in the pop-up. The 'return false' bit in the onClick attribute
stops the file referenced in the href attribute being opened. If javascript
is not available, then the file in href will open in the current browser,
and the user will still be able to see the picture.

Hope that helps,
Nige

--
Nigel Moss.

Email address is not valid. (e-mail address removed). Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
In the land of the blind, the one-eyed man is very, very busy!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top