PDA

View Full Version : image Onclick menu



Niclas
07-20-2008, 09:32 PM
Hi,

I have search alot to find a javascript with image onclick menu

I have a horizontal menu with 8 image buttons
I want following to happends with onclick function

1. When you click on button 1 it change and show image 1 as an active button

2. When you click on button 2 the first image go back to original mode and image 2 is active button

If you have a solutions on this javascript please insert the code on dynamic drive forum

Best Regards
Nick 67

Nile
07-21-2008, 05:33 AM
Its very easy, witch is why I will not do it for you, I will give you a feeling on how to do it. From there, once you've tried... And you cannot do it, I will make it for you.

Make two classes in the CSS. One for the current, and one for the non current, then in the mark up, add an onclick event to change one element to the non current class, and "this" element to the current class.

Niclas
07-27-2008, 09:16 AM
Hi Nile

First of all I use a mouseover javascript from Adobe

Head
<script type="text/javascript"><!--
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'button1',/*URL*/'buttons/btn1over.jpg',/*URL*/'buttons/btn1over.jpg',/*URL*/'','Home');

Body
<csobj al="Home" h="28" ht="buttons/btn1over.jpg" st="Home" t="Button" w="108"><a href="index.html" target="_parent" onmouseover="return CSIShow(/*CMP*/'button1',1)" onmouseout="return CSIShow(/*CMP*/'button1',0)" onclick="return CSButtonReturn()"><img src="buttons/btn1over.jpg" width="108" height="28" name="button1" border="0" alt="Home"></a></csobj>

I have tried and really donīt know how to setup a classes in my css?

If you have a simple solutions please insert the CSS code

Best Regards
Nick67