Reply to Re: OT: JavaScript quickie

Your name:

Reply:


Posted by cwdjrxyz on 01/21/08 20:48

On Jan 21, 11:31 am, "mrcakey" <nos...@spamispoo.com> wrote:
> Is it even possible to do this the way I'm trying to? I've got a menu where
> the background images change from desaturated to coloured on hover and when
> selected (all through CSS).
>
> As a "nice to have", I'd like to make it so that when the user is hovering
> over an image, the "selected" image is desaturated, i.e. only image at a
> time is coloured. This is how far I've got, but I'm a bit of a JavaScript
> noob and I'm not even sure what I'm trying to do is possible:
>
> http://mrcakey.co.uk/jones2/
>
> +mrcakey
> function menufun(x)
> {
> var fun = new Array();
> var i = 0;
> fun[0] = document.getElementById('home');
> fun[1] = document.getElementById('gallery');
> fun[2] = document.getElementById('treatments');
> fun[3] = document.getElementById('testimonials');
> fun[4] = document.getElementById('fees');
> fun[5] = document.getElementById('contact');
>
> for (i in fun)
> {
> var elem = fun[i];
> if ( i == x )
> elem.ClassName = 'current';
> else
> elem.ClassName = '';
> }
>
> }

If you do not get an answer here to your liking, you might try the
Usenet group comp.language.javascript. From the code you give, I am
not for sure what you are doing. A very direct way to do this sort of
thing would be to place both the normal image and a desaturated
version of the same image(made with some image processing tool) in the
same location using absolute positioning. Then script might be used to
switch from one image to the other on hovering over the image, using
visibility. I have never done this, but it seems likely that such a
script could be made to work. I do not have time at the moment to
experiment with this approach.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация