Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorkayloe
    • CommentTimeMar 18th 2007
     permalink
    Hi there jQuery ninjas

    I'm playing with the idea of creating a FAQs section for a site which has a OL with DIVS that are hidden/collapsed onload and shown onclick

    I've set up the LIs and the DIVs with IDs and anchor tags, so when a user clicks on a bookmarked FAQ, this appears onload

    can anyone help with this at all?
    • CommentAuthorPettyRider
    • CommentTimeMar 19th 2007
     permalink
    Split location.href at the # character. Grab the last item in this new array (if it exists). Use the resulting string to set that DIV's display to 'block'
  1.  permalink
    Nice and to-the-point help there PettyRIder. Also, maybe location.hash may work and simplify the process further?
    •  
      CommentAuthorkayloe
    • CommentTimeMar 20th 2007
     permalink
    Thanks guys

    I ended up using a similar method to the one PettyRider suggested. A var was set from the location.href and the substring extracted
    Then a routine was run to search for a href match and voila! Hey presto... even with 30 FAQs on the page it still loads in reasonable time.

    Thanks to jQuery and a little bit of fiddling around we have a solution. Plus, the FAQs are also content managed so the end user has absolute control.

    Win win.
    • CommentAuthorPettyRider
    • CommentTimeMar 21st 2007
     permalink
    Wasn't aware of location.hash. Thanks for the heads up!
Add your comments
    Username Password
  • Format comments as (Help)