www.webdeveloper.com
Results 1 to 4 of 4

Thread: colour change on menu

  1. #1
    Join Date
    Jul 2006
    Posts
    18

    colour change on menu

    I put up a similar post a few days ago to do with a push down menu problem.

    I'm now using a css text based pushdown menu . I've got this working but I'm still having the problem that I don't know how to show the 2nd colour of the rollover once a user has clicked on it and the sub menu rolls down and presents itself. I want the 2nd colour to remain static and not go away once the user mouse aways from it.

    Cheers

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    You need to use javascript to remember that the link was clicked and prevent the mouseout action. There isn't anything in css that will remember it, unless it is an anchor. But then all your visited links would have that style.

    Sorry, I forgot what forum I was in.

    When the item is clicked, set a flag for that item. Then when the mouseout occurs, check the flag.

  3. #3
    Join Date
    Jul 2006
    Posts
    18
    Cheers,

    I think I understand what I have to do but how do I go about doing it? Have you got a code example or a link to somewhere where I can learn how to flag up things? I'm really new to javaScript and a bit clueless.

  4. #4
    Join Date
    Nov 2002
    Posts
    4,473
    Quote Originally Posted by bluey83
    a bit clueless
    Menus are pretty advanced, and not knowing what you are using makes it near impossible to advise you.

    Usually objects have an ID that you use to script them. You can your own add parameters to any object by instantiating them. For example:
    Code:
    document.getElementById("para1").wasclicked = true;
    This adds the attribute "wasclicked" to some object called "para1". You should be careful not to use reserved words or attributes that already exist.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles