Results 1 to 5 of 5

Thread: "Current" id on menu tabs

  1. #1
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default "Current" id on menu tabs

    1) Script Title: Modern Bricks Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/style/cs...n-bricks-menu/

    3) Describe problem:

    How do you set the "current" id so it actually reflects the current tab the viewer has selected?

    The author appears to have randomly selected one tab for the "current" id, apparently for display purposes only.

    I've seen this with other menu scripts on this site. Never is an explanation included, and users post in vain, asking for an explanation.

    Why include a "current" id if you're not going to explain how it works?

  2. #2
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    On reflection, I'm guessing the "current" feature is not meant for use with blogs, but only with sites using static pages exclusively.

    With static pages, you can change the "current" tab to reflect the page the viewer is visiting.

    Unfortunately, since many of us are using blogs, the "current" feature becomes essentially useless.

    I'm sure many of us would welcome a "current" tab system that will work with blogs.

  3. #3
    Join Date
    Jun 2006
    Posts
    182
    Thanks
    0
    Thanked 14 Times in 14 Posts

    Default

    You need to do server side processing to decide where the id="current" goes.
    Although it may be possible to do that with javascript by looping through menu items and comparing their hrefs with current location.

  4. #4
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by DimX View Post
    You need to do server side processing to decide where the id="current" goes.
    Although it may be possible to do that with javascript by looping through menu items and comparing their hrefs with current location.
    This appears to be something that's way over my head. But again, many bloggers would be in the same predicament with the Dynamic Forums menu scripts.

  5. #5
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    To set id=current, all that's needed is some simple knowledge of common sense using scripts and coding.

    Below is a snippet of where the original current id is, and what i've done for it!

    HTML Code:
    <div id="modernbricksmenu">
    <ul>
    <li style="margin-left: 1px"><a href="http://www.dynamicdrive.com" title="Home">Home</a></li>
    <li><a href="http://www.dynamicdrive.com/new.htm" title="New">New</a></li>
    <li id="current"><a href="http://www.dynamicdrive.com/revised.htm" title="Revised">Revised</a></li>
    <li><a href="http://tools.dynamicdrive.com" title="Tools">Tools</a></li>	
    <li><a href="http://www.dynamicdrive.com/forums/" title="DHTML Forums">Forums</a></li>	
    </ul>
    <form id="myform">
    <input type="text" class="textinput" /> <input class="submit" type="submit" value="Find" />
    </form>
    </div>
    As you can see, the id=current is set inbetween the first <li> tag where the revised is situated. So all you need to do is cut the id="current" out of where it currently is from the code on the modern brick page now and paste in line with the <li> tags of where you want...e.g. home. Now below, you can see i have named my own navigation, left the links blank for now (as i am currently creating a site and have no links as of yet), and pasted the id="current" in the "home" line inside the li tags in the same position as before (if that makes sense) Take a look and it should become clear. All i have done is basically used some sense to see where it was, and cut and paste where it was needed.

    HTML Code:
    <div id="modernbricksmenu">
    <ul>
    <li id="current" style="margin-left: 1px"><a href="" title="Home">Home</a></li>
    <li><a href="" title="Services">SERVICES</a></li>
    <li><a href="" title="Portfolio">PORTFOLIO</a></li>
    <li><a href="" title="About">About</a></li>	
    <li><a href="" title="Contact">Contact</a></li>	
    </ul>
        </div>
    Hope this helps and makes sense, if not, do reply.

    Ryan.

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
  •