Results 1 to 6 of 6

Thread: Always on button for page navs?

  1. #1
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Always on button for page navs?

    Hi all, new to the site but have heard you are all really helpful!

    I have a problem with the 3 level DD menu here;

    http://www.dynamicdrive.com/style/cs...el_css_menu_2/

    It all works fine but what I need to do is have the current page button highlighted for whichever page the viewer is on (for instance the off state is grey and on state is orange on mouseover - but if they navigate to the contact page (eg) I want the link to stay orange (not go back to grey)- I really have no idea on this (have looked at other css where this is done but it will not work on mine)?

    Help REALLY appreciated!

    TIA.

    Pete
    Last edited by paganpete; 09-09-2009 at 04:40 PM.

  2. #2
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    Try inserting this into your CSS:
    Code:
    .active {
    background: orange;
    }
    then for the tab you wanna make the active one, change:
    Code:
    <li><a href="#">Sub Item 1.2</a></li>
    to this:
    Code:
    <li class="active"><a href="#">Sub Item 1.2</a></li>
    HTH
    - Josh

  3. #3
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks very much for the quick reply but it did not help - in dreamweaver the line is now coloured orange but in live view and on the site it does not appear (only put it on the about link page to test it) - please see link . . .

    http://www.blackdogsquare-design.co..../pd/index.html

    Also this is the full code copied from my css slide file

    .jqueryslidemenu{
    font: bold 10px "Trebuchet MS", sans-serif ;
    background: #ffffff;
    text-align:left;
    width: 100%;
    }

    .jqueryslidemenu ul{
    margin: 0;
    padding: 0;
    list-style-type: none;
    }

    /*Top level list items*/
    .jqueryslidemenu ul li{
    position: relative;
    display: inline;
    float: left;
    }

    /*Top level menu link items style*/
    .jqueryslidemenu ul li a{
    display: block;
    background: #ececec url(images/site-images/grey-menu-grad.png) top left repeat-x; /*background of tabs (default state)*/
    color: black;
    text-align:left;
    padding: 3px 48px 3px 5px;
    border-right: 1px solid #ffffff;
    color: #ffffff;
    text-decoration: none;
    }

    * html .jqueryslidemenu ul li a{ /*IE6 hack to get sub menu links to behave correctly*/
    display: inline-block;
    }

    .jqueryslidemenu ul li a:link, .jqueryslidemenu ul li a:visited{
    color: black;
    }

    .jqueryslidemenu ul li a:hover{
    background: #fd3815 url(images/site-images/orange-menu-grad.png) top left repeat-x; /*tab link background during hover state*/
    color: white;
    }

    /*1st sub level menu*/
    .jqueryslidemenu ul li ul{
    position: absolute;
    left: 0;
    display: block;
    visibility: hidden;
    }

    /*Sub level menu list items (undo style from Top level List Items)*/
    .jqueryslidemenu ul li ul li{
    display: list-item;
    float: none;
    }

    /*All subsequent sub menu levels vertical offset after 1st level sub menu */
    .jqueryslidemenu ul li ul li ul{
    top: 0;
    }

    /* Sub level menu links style */
    .jqueryslidemenu ul li ul li a{
    font: bold 12px "Trebuchet MS", sans-serif ;
    width: 170px; /*width of sub menus*/
    padding: 5px;
    margin: 0;
    border-top-width: 0;
    border-bottom: 1px solid #ffffff;
    color: #ffffff;
    }

    .jqueryslidemenuz ul li ul li a:hover{ /*sub menus hover style*/
    background: #eff9ff;
    color: black;
    }

    .active {
    background: orange;
    }



    /* ######### CSS classes applied to down and right arrow images ######### */

    .downarrowclass{
    position: absolute;
    top: 12px;
    right: 7px;
    }

    .rightarrowclass{
    position: absolute;
    top: 6px;
    right: 5px;
    }

    It should work like that but for some reason it will not have I messed up along the way?

  4. #4
    Join Date
    Feb 2009
    Posts
    303
    Thanks
    18
    Thanked 36 Times in 36 Posts

    Default

    Quick Fix: DON'T USE A PROGRAM. Use a plain-text editor [cough]Notepad++[cough] and Firefox, and that's all you need!!
    I found WYSIWYG editors to be a pain in the you-know-what...

    Have you tried using a hexadecimal code instead of the word "orange"? Try #FF5600.

    Cheers,
    X96
    Last edited by X96 Web Design; 09-10-2009 at 02:39 PM.
    Alex Blackie, X96 Design
    My Website
    I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration

  5. #5
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi X,

    I tried the hex code and the orange line appears in the dreamwevaer view but not in the live view or on the uploaded site!

    Really confused by it!

  6. #6
    Join Date
    Feb 2009
    Posts
    303
    Thanks
    18
    Thanked 36 Times in 36 Posts

    Default

    Try putting class="active" on the <A> tag instead of the <LI>. See if that works....

    Cheers,
    X96
    Alex Blackie, X96 Design
    My Website
    I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration

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
  •