Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Change Menu_Item Font Color

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #150067
    lrelia
    Participant

    Hey,guys.I want to make menu items to have different font color.But I failed.Can anyone help?Any help will be thankful.^ ^
    http://codepen.io/lrelia/pen/xAHwF

    #150072
    whatsoever
    Participant

    This would do it ;)

    http://jsfiddle.net/VzDhP/

    You first tired to define colors as an object, using object literal notation like so: var colors = {'red', 'green, ... etc}; And colors actually needs to be an array: var colors = ['red', 'green',...etc];

    Just a heads-up, when defining objects using object literal notation remember that objects contain key:value pairs, like so: var my_object = { key1: value1, key2:value2 ... };

    Then they can be accessed using this:my_object.key1; // returns value1

    #150073
    lrelia
    Participant

    @jurotek,yes,like this,but I want to use JS to make it.

    #150075
    lrelia
    Participant

    Much thanks,guys^ ^

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.