Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-21 08:57:37

Castrobot
New Member
Registered: 2008-04-12
Posts: 7

Rollover images

Hi all,

I was wondering if there is some textpattern shortcut coding that we can use or do we have to go the old javascript way to make rollovers?

For example, I was wondering if linking my source images should be done the “texpattern way”…
“<txp:site_url/>images/home/1beratung.png”
or just
“images/home/1beratung.png”

Thanks in advance! (and sorry if it sounds a little dumb…)

edit: nevermind, I found a solution, but i would still be curious to know if there is another way than javascript…

Last edited by Castrobot (2008-04-21 09:55:13)

Offline

#2 2008-04-21 13:02:37

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Rollover images

If by “rollovers” you mean a linked image that changes when you hover over it then that can be done in CSS. You create a double image, that is you have the normal image at the top and the hover image underneath but within a single, larger image. You then call the image as a background in your CSS for the linked selector and for the :hover state adjust the vertical alignment so that in effect the image slides up to reveal the other version.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2008-04-21 13:49:19

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Rollover images

Some css techniques are explained here and here

Last edited by colak (2008-04-21 13:52:54)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2008-04-21 17:42:04

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Rollover images

Castrobot:

Even though yopu found a solution, thought I would throw this your way as another alternative: simpleswap.js

progre55

Offline

#5 2008-04-21 18:44:30

Castrobot
New Member
Registered: 2008-04-12
Posts: 7

Re: Rollover images

Very nice and simple this css technique, thanks guys, that’s appreciated.

progre55: thanks for the link too, but i was looking for an alternative of the javascript method, since it requires many lines of code, i still did it this way…

Offline

Board footer

Powered by FluxBB