Note that there are some explanatory texts on larger screens.

plurals
  1. POfunction(){If fadeout, then append} is not working
    primarykey
    data
    text
    <p>I am aware of jQuery UI's sortable option, but drag-and-drop isn't what I'm looking for.</p> <p>Due to the way of how accordions are laid out, I think in order to sort them, the best way to go about it is to change the id, unsafe as that sounds.</p> <p>This is what one of my accordions look like.</p> <p>Copy code</p> <pre><code>&lt;table style="background: none repeat scroll 0% 0% rgb(186, 218, 85); display: none;" tabindex="-1" aria-selected="false" aria-controls="ui-accordion-accordion1-panel-2" id="ui-accordion-accordion1-header-2" role="tab" class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-accordion-icons"&gt;&lt;span class="ui-accordion-header-icon ui-icon ui-icon-triangle-1-e"&gt;&lt;/span&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;... Yadayada, content. End table tags. </code></pre> <p>This is the code I use.</p> <pre><code>function pagination() { for (var i = 0; i &lt; 10 ; ++i) { var k = i * 1000; var j = i * 100; var index; console.log("aftervar " + i); if ($("#ui-accordion-accordion1-header-" + i).css("display") == "none") { $("#ui-accordion-accordion1-header-" + i).attr("id", "ui-accordion-accordion1-header-" + j); $("#ui-accordion-accordion1-panel-" + i).attr("id", "ui-accordion-accordion1-panel-" + j); index = $("#ui-accordion-accordion1-header-" + j); $("#accordion1").append($("#ui-accordion-accordion1-header-" + j)); console.log("if " + i); } else {/* k += 1; $("#ui-accordion-accordion1-header-" + i).attr("id", "#ui-accordion-accordion1-header-" + k); $("#ui-accordion-accordion1-panel-" + i).attr("id", "#ui-accordion-accordion1-panel-" + k);*/ } } $("#tabs-1 table:nth-of-type(odd)").css("background", "#BADA55"); $("#tabs-1 table:nth-of-type(even)").css("background", "#FFFFFF"); $("#table-headings").css("background", "#FFFFFF"); } </code></pre> <p>I'm using the ids to sort it out. The other problem is that the appends aren't working as they should (in fact, I put a console.log in there and it seems the if statement does not run sometimes). The elements stay where they are and the appended is typically text of the id or nothing at all.</p> <p><a href="http://jsfiddle.net/Cb3U2/5/" rel="nofollow">http://jsfiddle.net/Cb3U2/5/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload