473,574 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OnClick Event Question

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
Jul 20 '05 #1
5 1544
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.

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

Jul 20 '05 #2
Spank wrote:
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.

--
Randy

Jul 20 '05 #3
An easier way, add a HREF to point to '#'
"Spank" <sp*********@ya hoo.com> wrote in message
news:1b******** *************** ***@posting.goo gle.com...
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

Jul 20 '05 #4
Randy Webb wrote:
Spank wrote:
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.


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>

Jul 20 '05 #5
While the city slept, mscir <ms***@access4l ess.net> feverishly typed:
Randy Webb wrote:
Spank wrote:
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.


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="myjsfu nction('mypic.j pg'); return false;"><img
src="mythumbnai l.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. ni***@nigenetDO G.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!
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3678
by: Shock | last post by:
Hello everyone, I am having a problem with the program below. I have isolated the problem to the onclick event that is located throughout arrQuestions. The onclick event refers to a function and passes it two parameters. For the life of me I cannot figure out what the error is, but one occurs everytime I click a &%*$&# radio button. ...
2
7020
by: Andreas Knollmann | last post by:
Hi, I create an object like this: var cell = document.createElement("td"). It doesn't have to be cell. I want this cell to use the onclick event. What doesn't work in the IE as well as with Mozilla is: cell.onclick = "whatever()";
3
3249
by: Jamie Jackson | last post by:
I'm rewriting all links' onclick events, but I'm having a problem. The onclick event that I'm inserting works correctly in Opera, but not in FF or IE. I'm retroactively adding the statement "return promptBeforeOpening();" FF and IE rewrite it as I would expect them to, but it turns out that that doesn't work (no disclaimer pops up, and...
2
18553
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } Which is called statically by: <button onclick="doClick(event,this);">Click me</button>
2
20500
by: abs | last post by:
Hi all. Is that possible to call the onclick, onchange or other event from JS ? I mean how to make the browser think that user clicked the element (onclick event) ? Eg. I have <element onclick='myFunction()'> and I don't want to call the myFunction() by writing its name in the code but I want to call the onclick event without clicking :) I...
5
13939
by: Stuart Shay | last post by:
Hello All I am working on ASP.NET 1.1 Custom Pager that allows a User to Enter a Number in a TextBox and go to the page selected. Since the OnClick Event does not work in ASP.NET 1.1 for a TextBox I want to use a hidden button to fire when the Onclick Event is fired for the TextBox.
10
4056
by: Carlos Araya | last post by:
I have the following link on a web page <p class="menuitem"><a href="#" onclick="loadFragment('http://rivendellweb.net/fortress/home', 'index')" title="The Fortress Home">The Fortress Home</a></p>
2
2820
by: =?Utf-8?B?Uml0YUc=?= | last post by:
I posted this question in the C# discussion group but am posting it here also since ASP is involved. I'm new to C# and need some help regarding an onClick event not firing. I have a data grid that I add a cell to programatically. The cell is a hyperlink and the onClick is set to _doPostBack. In my code I handle the event but when I click...
1
4075
by: sourcie | last post by:
I am changing an existing quiz found on "JavaScriptKit.com Multiple Choice Quiz" I have an image. Instead of using the radio buttons with the normal true/false question, I want to place two hotspots on the image. One being correct(a) and the other incorrect(b). When the user clicks on the correct hotspot or place on the image, it should score...
17
2660
by: yawnmoth | last post by:
http://www.frostjedi.com/terra/scripts/demo/this-alert.html http://www.frostjedi.com/terra/scripts/demo/this-alert2.html Why, when you click in the black box, do the alert boxes say different things? Shouldn't they say the same thing?
0
7794
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7710
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8040
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8225
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8092
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5296
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2230
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.