We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28373
    • 204 Posts
    At the moment the dropmenu script generates a class for the last items in a menu. ie,

    <li class="last">

    This is great because I’ve got a css menu that makes extensive use of sprite manipulation in order to optimize button graphics and rollovers - and at the end of the menu the sprite position is moved so that the graphic for the last button has a rounded corner. So, using the class "last" I can separate it’s background position.

    The problem I’m having, is that the method is also used for the first button - so I really need to generate a class for the first item in the navigation and call that, say; "first". ie. <li class="first">

    Would anyone know a quick hack for the DropMenu script - so I can attach such a class to the first item in the menu ?

    I’m not a php person so any tips would be greatly appreciated - thanks smiley

      • 25663 MODX Staff
      • 12,272 Posts
      Log it in the bugtracker as a dropmenu request. This weekend sees dropmenu work a goin’ on.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 28373
        • 204 Posts
        Quote from: rthrash at Mar 30, 2006, 09:22 PM

        Log it in the bugtracker as a dropmenu request. This weekend sees dropmenu work a goin’ on.

        No problem - I hacked it myself, if your interested in the menu I was talking about go to

        http://www.modxhost.com/menu/modxhostmenu.htm

        If your playing the the dropmenu you might want to fix the top level ul - it might want to be an ID not a class, unless you’d anticipated it being used more than once in the same document. I had to make it an ID since I hit problems trying to implement the script using getelementbyClass and IE6, worked fine with FF - but did nothing for IE

        Once I’ve integrated the menu with the tutorials and site redesign, I’ll publish the hack and the navigation system etc etc

        Thanks Anyway smiley

        NB: I haven’t cleaned the css yet, yeah - it’s still in beta like IE7, and it’s not live either smiley
          • 25663 MODX Staff
          • 12,272 Posts
          Nice menu. Please share the hacks when you get them ready. Thanks!
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 28373
            • 204 Posts
            Quote from: rthrash at Mar 30, 2006, 11:09 PM

            Nice menu. Please share the hacks when you get them ready. Thanks!

            The dropmenu hack is here

            http://www.modxhost.com/menu/dropmenufirstlast.zip

            The hack adds ’first’ to the first instance of category, and ’first’ to the first sub menu list item, and changes the top level ul to an ID.

            eg

            <ul id="topnav">
            <li class="firstcategory">Item
            <ul>
            <li class="first">

            It’s useful for the methods used in the menu smiley