ページの作成

ページの作成

親となるページを選択してください。

ページは必ず何かしらの親ページに紐づきます。
親ページに紐づくページを子ページといいます。
例: 親=スポーツ, 子1=サッカー, 子2=野球

子ページを親ページとして更に子ページを作成することも可能です。
例: 親=サッカー, 子=サッカーのルール

親ページはいつでも変更することが可能なのでとりあえず作ってみましょう!
テンプレートを更新

11. 【jQuery】スマホやWebで項目をタッチ/クリックしてスライドさせる方法【Javascript】

必要なライブラリ

<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.css' />  

<script src='https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js'></script>

<script src='https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js'></script>  

 

実装

<ul class="menu_ul">
    <li>
        menu1
    </li>
    <li>
        menu2
    </li>
</ul>


<script>
$(function() {
    $(".menu_ul")
.sortable({
       
axis: 'y',
    });
});
</script>

axisでスライドさせる方向を指定する。

yは縦、xは横となる。

 

サーバーサイドに並び順を送信する方法

<form id="menu-sort-form" method="POST" action="...">
    <input id="_method" name="_method" type="hidden" value="PUT">
    
    <ul class="menu_ul">
        <li
id="1">
            menu1
        </li>
        <li
id="2">
            menu2
        </li>
    </ul>
    
    <button id="
confirm">確定</button>
    <input type="hidden" id="
sort_order" name="sort_order" />
    
</form>

<script>
$(function() {
    $(".menu_ul").sortable({
        axis: 'y',
    });
});

$("#confirm").click(function() {
    var array = $(".menu_ul")
.sortable("toArray");
    $("#
sort_order").val(array);
    $("#
menu-sort-form").submit();
});


</script>

確定ボタンを押すとサーバーサイドで以下の様にlistのidの値を受け取ることが出来る。

 'sort_order' => '1,2'

 

子ページ
子ページはありません
同階層のページ
  1. 導入方法
  2. 文法
  3. HTML/CSS操作・制御
  4. 要素の取得
  5. 値の取得
  6. 値と要素の追加
  7. 値と要素の削除
  8. 子要素の削除
  9. 要素のコピー
  10. Ajax
  11. 項目をタッチ/クリックしてスライドさせる方法
  12. テキスト/セレクトボックス/ラジオボタン変更時のイベント
  13. パスワードを一時的に表示させる方法

最近更新/作成されたページ

最近の質問

コメント一覧

    No.3 | guest | 2019-10-04 09:03:57

    For anyone who is a period player in the casino, you'll be given a reward. Outside you use the more those negative odds are going consume ibto your bankroll. http://m.emo.r.andu.m.z.s.q.y@dr.ess.Aleoklop.e@www.your-hoster.de/info.php?a%5B%5D=%3Ca+href%3Dhttp%3A%2F%2Face333.gdn%2Findex.php%2Fother-games%2Fsky777%2F6-sky777%3Esky+777%3C%2Fa%3E

    No.2 | guest | 2019-08-03 11:23:12

    Firstly you need the keywords. You need keywords on your page will be relevant to that of the search term. The most important thing about this is that when your visitors get to your page, they stay there! Feeling confident most important is which you will get ranked higher because of it. Google LOVES pages that are extremely the search terms. This might usually applies more to sponsored links, it also uses this method to position pages higher on their free results. This concept is also relatively recent. It has worked for example charm for me personally. The idea is always to name a list 'contact-a-web-designer.html' rather than just 'contact.html'. Or rename your 'download' folder as 'download-cheap-web-templates'. May make any sense? I hope it does. Try it, totally . not be sorry. I found a used copy of one's book in the thrift store, but you will find it here on Amazon if regional used book store is deficient in a copy available. The price on Amazon for a Kindle version is $7.99, but used physical copies sell at a lower price on the site. Article gathering helps to assemble many keywords; there a wide range of article directories that want to accept your content regularly and return you certain links. May do take without the aid of automated programs to send these articles instead of using this method manually. Go towards the Google search page, type any keyword and hit enter. Associated with noticed the starting regarding each production? It's the 'title' of the web page. So, it goes without proclaiming that 'title' is crucial. You must have an appropriate 'title' for your web site containing essentially the most relevant key terms and phrases. There an additional effective strategy to bring popularity for objective and that can be done through link send. Link exchange can result within a good page rank for website and can improve the google search ranking. Third step is to submit will probably to some Open Directory Project; DMOZ is good and is commonly employed as basis by many search engines like Google, MSN and Alexa. Process again takes several months. So, the first step plays the perfect here extremely. No you can guarantee the top perfect Google Page ranks except Google but all the above techniques can assist you in getting top position in Google page standing. http://ace333.gdn/index.php/other-games/play8oy/3-play8oy

    No.1 | guest | 2019-03-08 01:03:41

    roulette online money slots card games online gambling online poker online real money