Reply to OT: JavaScript quickie

Your name:

Reply:


Posted by mrcakey on 01/21/08 17:31

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 = '';
}

}

[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

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