Results 1 to 3 of 3

Thread: image Onclick menu

  1. #1
    Join Date
    Aug 2006
    Location
    Sweden
    Posts
    19
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default image Onclick menu

    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
    Last edited by Niclas; 07-20-2008 at 09:45 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    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.
    Jeremy | jfein.net

  3. #3
    Join Date
    Aug 2006
    Location
    Sweden
    Posts
    19
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •