views:

38

answers:

1

Hello,

I'm using this code to make the accordion sortable, and to make the active accordion panel move to the top of the stack:

    $(function() {
    var stop = false;
    $("#ccaccordion h3").click(function( event ) {
        if ( stop ) {
            event.stopImmediatePropagation();
            event.preventDefault();
            stop = false;
        }
    });

    $("#ccaccordion").accordion({
            header: "> div > h3",
            autoHeight: false,
            change:
              function(event, ui){
                ui.newHeader.parent().prependTo(this);
              }
        }).sortable({
            axis: "y",
            handle: "h3",
            stop: function() {
                stop = true;
            }
        });

});

However it doesn't seem to be working. The standard demo code works fine with my html:

    $(function() {
        $( "#ccaccordion" ).accordion();
    });

Any ideas where I'm going wrong?

Thanks in advance!

+1  A: 

Sorted,

I wasn't wrapping the h3 and subsequent div with another div. Knew it would be something simple. Thanks for your time Thomas! Yet again it was just me being an idiot...

Robimp
Awesome. :) I didn't see any of your answers to my comment. I think you have to prefix them with @Thomas: for me to be notified.
Thomas