SitePoint Sponsor |
|
User Tag List
Results 1 to 12 of 12
Thread: Hover or Rollover?
-
Jun 27, 2001, 13:00 #1
- Join Date
- Mar 2001
- Location
- Philadelphia, PA
- Posts
- 130
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hover or Rollover?
Hello all,
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.
I am somewhat familiar with CSS :hover, and Javascript rollovers, but I think CSS :hover only works with text, and I've only written JS rollovers with active page links. Can I somehow take the <a href > out of the JS command and have it work?
Other Solutions?
-
Jun 27, 2001, 14:04 #2
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You could have it set up so that the user rolls over a piece of text but the image it what changes.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Jun 27, 2001, 14:56 #3
- Join Date
- Apr 2001
- Location
- Toronto, Ontario, Canada, Earth
- Posts
- 138
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
hello,
i could be wrong, but i don't think there's a way to completely remove the link. however, you could do something like this:
Code:<html> <head> <script language=JavaScript> function over() { document.images[0].src = "ul.gif"; } function out() { document.images[0].src = "ur.gif"; } </script> <body> <a href="JavaScript:over()" onmouseover="over();return true" onmouseout="out();return true"> <IMG SRC="ur.gif"> </a> </body> </html>
Jason Weinstein
webmaster@MaximumEdge.com
http://www.MaximumEdge.com/Last edited by maximumedge; Jun 27, 2001 at 18:26.
-
Jun 28, 2001, 04:47 #4
- Join Date
- Mar 2001
- Location
- Philadelphia, PA
- Posts
- 130
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You could have it set up so that the user rolls over a piece of text ...
i could be wrong, but i don't think there's a way to completely remove the link...
Still searching for an alternative.Thanks for your input.
Maybe I'll post this in Client Side Scripting category.
Last edited by abwebs; Jun 28, 2001 at 04:53.
-
Jun 28, 2001, 06:58 #5
- Join Date
- Apr 2001
- Location
- Toronto, Ontario, Canada, Earth
- Posts
- 138
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by abwebs
Tried it, still goes to another page if user clicks on it.
Jason
-
Jun 28, 2001, 07:05 #6
- Join Date
- Oct 2000
- Location
- Springfield, Missouri, U.S.A.
- Posts
- 320
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
you could have it link back to the same page if you can't think of a way to do it without a link. or you could even have it link to an anchor thats located at the same area, so if the user clicks on it, nothing happens.
-
Jun 28, 2001, 07:10 #7
- Join Date
- Apr 2001
- Location
- Toronto, Ontario, Canada, Earth
- Posts
- 138
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by lucas
you could have it link back to the same page if you can't think of a way to do it without a link. or you could even have it link to an anchor thats located at the same area, so if the user clicks on it, nothing happens.
Jason Weinstein
webmaster@MaximumEdge.com
http://www.MaximumEdge.com/
-
Jun 28, 2001, 07:21 #8
- Join Date
- Mar 2001
- Location
- Philadelphia, PA
- Posts
- 130
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Exactly what I was trying to avoid - loading a page ! Thanks again for your help maximumedge! !
<a href="java script: over()" onmouseover="over();return true" onmouseout="out();return true"> <IMG SRC="example.jpg"> </a>
seems to work!
-
Jun 28, 2001, 20:10 #9
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you can't get that working then you could just leave it as a link but implement the "No refresh" link setup that Kevin Yank describes.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Jun 29, 2001, 15:11 #10
- Join Date
- Sep 1999
- Location
- Singapore
- Posts
- 854
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try
Code:<a href="javascript:;" ....>
That way you don't trigger any javascript clicking on the "link".
-
Jun 29, 2001, 22:11 #11
- Join Date
- Mar 2001
- Location
- San Jose, California
- Posts
- 46
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This may be of some help.
http://66.34.42.140/forums/showthrea...?threadid=8217
judge
-
Jul 1, 2001, 11:31 #12
Can't you just put the onMouseOver in the <img> code?
Bookmarks