mercredi 6 mai 2015

Open a particular accordion div after ajax call

I am submitting some values to database through ajax and i want to reload and open a particular accordion div after ajax call.

This is what i was trying and it doesn't work=

'success' : function(data){
                    $("#divId").html(data);

                     $("#divId").load(window.location + "#divId");
                       $("#accordion").accordion("option", "active", $("#activeDiv").index("#accordion div"));

            }

HTML code is here:

<div  id="accordion">
 <h3>heading 1</h3>
 <div id="activeDiv">
   <p>kksksksksk</p>
 </div>
 <h3>heading 2</h3>
 <div id="activeDiv1">
   <p>kksksksksk</p>
 </div>
 <h3>heading 3</h3>
 <div id="activeDiv2">
   <p>kksksksksk</p>
 </div>
</div>

Aucun commentaire:

Enregistrer un commentaire