Technical Discussion
  >> Web Design / HTML / Web hosting Forum


Register (or login) on our website and you will not see this ad.


These posts have been archived and can no longer be replied to or modified.
  Print Thread
Standard User danstevens
(regular) Thu 01-Jun-06 14:45:23
Print Post

Duotone images on mouse over


[link to this post]
 
Hello

I want to copy the effect on this page whereby black and white images change to colour on mouse over. Does anyone know how it is done?

http://www.sussex.ac.uk/

thanks

Dan
Standard User deleted
(deleted) Thu 01-Jun-06 15:17:14
Print Post

Re: Duotone images on mouse over


[re: danstevens] [link to this post]
 
a start..

http://www.alistapart.com/articles/rollovers/

http://www.alistapart.com/articles/domtricks2/
Standard User deleted
(deleted) Thu 01-Jun-06 15:48:35
Print Post

Re: Duotone images on mouse over


[re: danstevens] [link to this post]
 
Simple. You just take a copy of the colour image and make it greyscale in any decent picture editing program (Photoshop, Paint Shop Pro etc). Then on your webpage use javascript to update the background-image with the URL of the colour image, not forgetting the mouseout which swaps them back again...


Register (or login) on our website and you will not see this ad.

Standard User Conneh
(newbie) Tue 06-Jun-06 21:47:48
Print Post

Re: Duotone images on mouse over


[re: deleted] [link to this post]
 
ok, those tutorials involve code, so im not very good in that department, but i do my roll overs in adobe image ready, simple the button you want to change, u need to duplicate it so you have the original, and the over. when slicing it, select the slice with with the button in, then in the web pallette (window > webpallette, i think) rite click on it and click "Add roll over state" in the the roll over state make it so the roll over is showing. Any problems and i didnt explain to good pm me

*Edit* I am happy to write a full tut with images if need be *Edit*

Edited by Conneh (Tue 06-Jun-06 22:01:31)

Standard User deleted
(deleted) Wed 07-Jun-06 09:41:00
Print Post

Re: Duotone images on mouse over


[re: Conneh] [link to this post]
 
i don't think you understood what the op is asking for. roll overs for the same image are easy enough to do, the op wants roll overs to be enabled when they mouse over a different element,

mouse over link -> related image rolls over as opposed to, mouse over link -> link image changes

see?
Standard User levi_g
(knowledge is power) Wed 07-Jun-06 13:55:18
Print Post

Re: Duotone images on mouse over


[re: deleted] [link to this post]
 
I thought it was a rollover of the image selected going by the link provided.

_______________________________________________
Hi Velocity 2mb via Zyxel p2602HW
Speedtest 1meg - - - - Speedtest 2meg
Standard User deleted
(deleted) Wed 07-Jun-06 14:10:06
Print Post

Re: Duotone images on mouse over


[re: levi_g] [link to this post]
 
Not always. Their website is rather inconsistent - 3 of the 6 images do change when you mouseover them, the whole article seems to trigger the effect. The other 3 images only change when you mouseover one of the links within the article.

It's the second effect that I think the OP is asking for. It can be accomplished quite easily using the following javascript on mouseover of the link text:

document.getElementById('image_tag_id').style.backgroundImage='url(color.jpg)';

and then on mouseout:

document.getElementById('image_tag_id').style.backgroundImage='url(blackwhite.jpg)';


Where image_tag_id is the ID value of the image that you want to change. Example HTML snippet:


<a href="link_target.htm" onmouseover="document.getElementById('myImage').style.backgroundImage='url(color.jpg)';"
onmouseout="document.getElementById('myImage').style.backgroundImage='url(blackwhite.jpg)';">link text</a>

...

<img id="myImage" src="blackwhite.jpg" />


Probably more elegant to write a javascript function, but the above should work as an example.
Standard User Conneh
(newbie) Wed 07-Jun-06 16:34:53
Print Post

Re: Duotone images on mouse over


[re: deleted] [link to this post]
 
Ok it seems i have got a tad confused. So this is not what you mean

http://con.neronix.com/Rollovers/index.html
  Print Thread

Jump to