Connecting Tech Pros Worldwide Forums | Help | Site Map

OnClick Event Question

Spank
Guest
 
Posts: n/a
#1: Jul 20 '05
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

Fabian
Guest
 
Posts: n/a
#2: Jul 20 '05

re: OnClick Event Question


Spank hu kiteb:
[color=blue]
> 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?[/color]

Style sheets.

..blah { cursor: hand; }

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

--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Randy Webb
Guest
 
Posts: n/a
#3: Jul 20 '05

re: OnClick Event Question


Spank wrote:
[color=blue]
> 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[/color]

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

--
Randy

Alan P
Guest
 
Posts: n/a
#4: Jul 20 '05

re: OnClick Event Question


An easier way, add a HREF to point to '#'
"Spank" <spankbuddda@yahoo.com> wrote in message
news:1be98ac4.0401130328.4050101a@posting.google.c om...[color=blue]
> 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[/color]


mscir
Guest
 
Posts: n/a
#5: Jul 20 '05

re: OnClick Event Question


Randy Webb wrote:[color=blue]
> Spank wrote:
>[color=green]
>> 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[/color]
>
>
> If you want it to act, look, and feel like a link, then make it a link.[/color]

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>

nice.guy.nige
Guest
 
Posts: n/a
#6: Jul 20 '05

re: OnClick Event Question


While the city slept, mscir <mscir@access4less.net> feverishly typed:
[color=blue]
> Randy Webb wrote:[color=green]
>> Spank wrote:
>>[color=darkred]
>>> 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[/color]
>>
>>
>> If you want it to act, look, and feel like a link, then make it a
>> link.[/color]
>
> 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>[/color]

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. nigel@nigenetDOG.org.uk. 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!


Closed Thread


Similar JavaScript / Ajax / DHTML bytes