SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2010
    Location
    Clarkston, WA
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question jQuery accordion panel show li:first as active

    Alright, so I'm stumped!

    I've got an accordion horizontal panel, and I have it set to display #accordion li:last - on page load. Then clicking on the panel lables will open other panels

    my delimma is that on page load, the content of the active panel is not displayed until you click on its respective "label"..

    I think I'm missing some code for the activeItem... I need it to show the content of that li tag on page load..

    ALSO, I've tried giving the li tag I want displayed first its own id, but had no luck with that..

    here's my code

    $(document).ready(function(){

    activeItem = $("#accordion li:last");
    $(activeItem).addClass('active');



    $("#accordion li").click(function(){
    $(activeItem).animate({width: "40px"}, {duration:300, queue:false});
    $(this).animate({width: "810px"}, {duration:300, queue:false});
    activeItem = this;
    });

    });
    link to live version:
    http://icodeinpink.com/valleyvision
    Last edited by mobil3gen; Aug 25, 2011 at 10:51. Reason: Added link

  2. #2
    SitePoint Member
    Join Date
    Dec 2010
    Location
    Clarkston, WA
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    resolved!


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
  •