Lorem Ipsum
“Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…”
- What is Lorem Ipsum?
- Why do we use it?
- Where does it come from?
- Where can I get some?
- The standard Lorem Ipsum passage, used since the 1500s
- Section 1.10.32 of “de Finibus Bonorum et Malorum”, written by Cicero in 45 BC
- 1914 translation by H. Rackham
- Section 1.10.33 of “de Finibus Bonorum et Malorum”, written by Cicero in 45 BC
今回はリストの順番を入れ替える動きをjQueryで実装しました。
jQuery-uiのサイトを見れば、ある程度自由にサンプルを実装できそうです。
コードは以下の通りです。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<h2>Lorem Ipsum</h2>
<p>"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."</p>
<ul id="sortable">
<li>What is Lorem Ipsum?</li>
<li>Why do we use it?</li>
<li>Where does it come from?</li>
<li>Where can I get some?</li>
<li>The standard Lorem Ipsum passage, used since the 1500s</li>
<li>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC</li>
<li>1914 translation by H. Rackham</li>
<li>Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC</li>
</ul>
<script>
$( function() {
$( "#sortable" ).sortable();
$( "#sortable" ).disableSelection();
} );
</script>