SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: Hover but no link
-
Jun 28, 2001, 05:02 #1
- Join Date
- Mar 2001
- Location
- Philadelphia, PA
- Posts
- 130
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hover but no link
Hello,
I have what seems to be a simple idea, but I can't seem to figure out how to implement it. I'd like to have one .jpg swap for another .jpg when a user hovers over the image with their mouse, however I DO NOT want the .jpg to have an active link to another html page if clicked.
Could I do this with a Javascript? The Jscripts I am familiar with require a link.
-
Jun 28, 2001, 05:26 #2
- Join Date
- Jun 2001
- Location
- Toronto, Canada
- Posts
- 9,123
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
yeah, but why not just have <a href="javascript:blah()">... though it's a link it doesn't GO anywhere. However, you CAN put the <img src="whocares.jpg" onMouseover="switch()"> but it will not work in certain browsers.
-
Jun 28, 2001, 06:58 #3
- Join Date
- Mar 2001
- Location
- Philadelphia, PA
- Posts
- 130
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by studiococo
yeah, but why not just have <a href="javascript:blah()">... though it's a link it doesn't GO anywhere. However, you CAN put the <img src="whocares.jpg" onMouseover="switch()"> but it will not work in certain browsers.
What do you mean it doesn't GO anywhere? Thanks to maximumedge I tried
<a href="java scriptver()" onmouseover="over();return true" onmouseout="out();return true"> <IMG SRC="example.jpg"> </a>
and the image is still 'active' to click on for the user. The user would click on it and get a file not found.
Is this what you are referring to in your first example?
thanks.
-
Jun 28, 2001, 06:59 #4
- Join Date
- Jun 2001
- Location
- Toronto, Canada
- Posts
- 9,123
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Yeah, do this instead:
<div onmouseover="over()" onmouseout="out()"><img src="whatever.jpg"></div>
-
Jun 28, 2001, 07:06 #5
- Join Date
- Apr 2001
- Location
- Toronto, Ontario, Canada, Earth
- Posts
- 138
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by abwebs
am by no means a JS expert so please bear with me.
What do you mean it doesn't GO anywhere? Thanks to maximumedge I tried
<a href="java scriptver()" onmouseover="over();return true" onmouseout="out();return true"> <IMG SRC="example.jpg"> </a>
and the image is still 'active' to click on for the user. The user would click on it and get a file not found.
Is this what you are referring to in your first example?
thanks.
Jason
-
Jun 28, 2001, 07:09 #6
- Join Date
- Jun 2001
- Location
- Toronto, Canada
- Posts
- 9,123
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Sitepoint separates the java and the script so that scripts can't be executed ever.
-
Jun 28, 2001, 07:17 #7
- Join Date
- Mar 2001
- Location
- Philadelphia, PA
- Posts
- 130
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by maximumedge
change 'java script' to one word and it should work.
Jason
Jason, It still gives an hourglass like it is going somewhere in Netscape (does nothing in IE), do I have to be concerned about it being invalid code, or just tolerate the usual Netscape nuances?
<div onmouseover="over()" onmouseout="out()"><img src="whatever.jpg"></div>Last edited by abwebs; Jun 28, 2001 at 07:53.
Bookmarks