Results 1 to 2 of 2

Thread: Achieving Accordion Script Effect with CSS?

  1. #1
    Join Date
    Nov 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Achieving Accordion Script Effect with CSS?

    Hi there,

    I've been admiring the Accordion Menu Script and I was wondering if there is a way to achieve a similar effect using CSS only?

    What I'm really after is to have a submenu open up when the main link is clicked on, then close again on a second click. I doubt it's possible with CSS but here's hoping!

    I'm currently only able to achieve a long menu of links with a headers above them to try to break them up into submenus, which looks incredible messy as you can imagine!

    Any ideas?

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    No, that can't be done with only CSS. CSS is a styling language. Generally speaking, you can't control interaction with it (unless you count anchors and the use of some pseudo states).

    You'll have to use some javascript.

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
  •