SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2011
    0 Post(s)
    0 Thread(s)

    adding ajax to jquery ui accordion

    Hello all... PHP guy here just getting into javascript/jQuery...

    I'm using jQuery's sortable accordion ( in an application to display elements that are in a set order. I was wondering if anyone could point me in the right direction on how to add ajax functionality to this so that when a user reorders the accordion list the order is updated on the server side.

    I'm sure this is pretty basic ajax stuff but i'm a complete noob with client side scripting

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    219 Post(s)
    12 Thread(s)
    Hi there,

    I'm guessing that the accordion uses jQuery UI's draggable functionality.
    If that is the case, then you probably want to listen for the "stop" event, which fires when a drag operation has finished.
    See also:

    Then you can hopefully do something like this:

    Code JavaScript:
    $( ".selector" ).on( "dragstop", function( event, ui ) {
        type : "POST",
        url : "myScript.php",
        data  : 'var=' + myVar,
        success : function(data) {
          //do something

    You might want to check out:

    Hope that helps.


Posting Permissions

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