Results 1 to 9 of 9

Thread: Annoying jQuery problem

  1. #1
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default Annoying jQuery problem

    This isn't really WordPress related, but it's for a plugin so I figured I'd ask it here:

    http://174.132.170.155/~demopix/

    That site has a grey widget which displays categories. It's a bit of a Frankenstein of code, but it works - almost, and is exactly what someone asked me to custom build for them.

    However now that I've built it, I've come across a rather annoying problem. The jQuery tabber script used to make it is rewriting the URLs for the sub-menu (where the uncategorized link is), wheras it was only supposed to do that for the top-level.

    I didn't realise this would happen until after I'd built it :( Any ideas on how to make those second level items have their correct URLs?

  2. #2
    Utkarsh is offline Hello World
    Join Date
    Nov 2009
    Posts
    73

    Default

    What exactly are you trying to achieve here?

  3. #3
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    It's a pulldown menu which currently displays a list of categories.

    But it could be extended to include lots of different things, like pages, posts etc. in their own separate tabs - hence I used a tabber script for it.

    If there is no simple way to get the URL's working like regular URL's then I could switch to some sort of accordion type menu setup I spose. I already knew how the jQuery tabber script worked though and when I first thought about how to do this it seemed like a reasonable solution.


    The problem stems from the fact that I'm nesting lists inside the tabber list, which is presumably not what the original developers of the tabbber script had in mind when they wrote it.

  4. #4
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    http://www.webresourcesdepot.com/wp-...sliding-menu/#

    I think this script might do the job actually ... annoying to have to recode now that I have it 'almost' working the way they need it to though :(
    Last edited by Ryan; 06-26-2010 at 12:33 PM.

  5. #5
    Utkarsh is offline Hello World
    Join Date
    Nov 2009
    Posts
    73

    Default

    I think you need to wrap inside another ul, as the 1st level <li> are converted into tabs.
    jQuery Tabs
    Code:
    <ul>
       <li><a href="">Column 1</a>
          <ul>
           ...<li>'s
          </ul>
       </li>
       ... other columns
    </ul>

  6. #6
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    Darn, I can't find any jQuery scripts that can do exactly what I require. I keep finding scripts that I think will work, but they all have problems of some sort.

    Any suggestions? There's bound to be some sort of off the shelf script which can do this, but I'm not even sure what I should be searching for.

    I can find plenty of scripts which will allow it to show and hide something. But none that will show/hide but also allow me to style the link different when it is the currently selected one.

  7. #7
    Utkarsh is offline Hello World
    Join Date
    Nov 2009
    Posts
    73

  8. #8
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    For the demo on that page, I would need the "Toggle" button to be styled differently when it's displaying something, from when it isn't. Unfortunately I can't find any examples which do that and I am JS moron so have no idea how to do it myself. It's probably stupidly simple, but I don't even know where to start.

    EDIT: Searching for "jQuery toggle" showed up a lot more useful things. Including this, which might work ... view-source:http://www.sohtanaka.com/web-design/examples/toggle/

  9. #9
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    Yup, that last one I found worked :) http://174.132.170.155/~demopix/

    Thanks for pointing out the term "toggle". That was the solution to my problem as it provided me the correct term to search with until I found an example that did exactly what I needed it to.

Posting Permissions

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