jQuery3でのhide showイベントが前verとちょっと変わっていた

jQuery3でのhide showイベントが前verとちょっと変わっていた

jQuery3を使用してみたのですが、show hideの使い方が以前と変わっていたので記録しておきます。

    <!-- jquery -->
    <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
    <link rel="stylesheet" href="themes/base/jquery.ui.all.css">
    <script type="text/javascript" src="ui/jquery-ui-1.8.12.custom.min.js"></script>


    // 返信テキストリンク(▼返信)クリック時の返信フォーム表示
    $(document).on('click', '[id^=reply_text_button_]', function(){
        var commentId = $(this).attr('id').replace('reply_text_button_', '');
        // 返信テキストリンクを非表示にする
        $(this).hide();
        // 返信フォームを表示する
        $('#reply_form_area_' + commentId).show( 'blind', '', 1000 );
    });

このblindというアニメーションを使用してみたら結構かっこよかったので気に入っています。

使用方法は上の通りです。

 

以上ジョナサンからでした。

Comments

No comments yet. Why don’t you start the discussion?

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です