Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-05 16:52:31

Mr. Smith
Member
From: Denmark
Registered: 2006-11-10
Posts: 56

Swap/replace image on hover over text links

Hey guys, I’ve tried Google, but still haven’t found what I’m looking for. I probably quite simple once you know how to do it.

I need a javascript or similar that allows me to specify an image that will be replaced when the user hovers his/her cursor over one of several text links. I’m looking for a solution that allows me to specify a different image to show dependent on what text link is hovered.

Can anybody please help me? :-)


Textpattern n00b

Offline

#2 2008-07-05 17:46:15

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: Swap/replace image on hover over text links

why javascript? you can use css’s :hover option


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#3 2008-07-05 18:10:45

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Swap/replace image on hover over text links

the_ghost wrote:

why javascript? you can use css’s :hover option

That works great for hovering over the actual image, but how would you make that work with a detached text link as Mr. Smith is asking for?

Offline

#4 2008-07-05 18:14:32

Mr. Smith
Member
From: Denmark
Registered: 2006-11-10
Posts: 56

Re: Swap/replace image on hover over text links

The text and the image placeholder are placed in two separate places on the page. Lets say that you hover over a “Cars” link – in that case a picture of a car may be shown, and if you hover over a “Beer” link a picture of a beer is shown. :-)


Textpattern n00b

Offline

#5 2008-07-05 18:59:02

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: Swap/replace image on hover over text links

suppose you could use :hover and background positioning


its a bad hen that wont scratch itself.
photogallery

Offline

#6 2008-07-05 20:06:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Swap/replace image on hover over text links

Offline

#7 2008-07-11 20:01:09

Mr. Smith
Member
From: Denmark
Registered: 2006-11-10
Posts: 56

Re: Swap/replace image on hover over text links

I will try out the css method and see if it works as intended. :-)


Textpattern n00b

Offline

Board footer

Powered by FluxBB