2

以下は私のコードスニペットです:

    <select  name="select_option">
      <option value="0">--Select Action--</option>
      <option value="1" class="delete_bulk_tests">Delete User</option>
      <option value="2" class="disable_bulk_tests">Disable User</option>
    </select>
    <div class="hidden">
      <div id="deletePopContent" class="c-popup">
        <h2 class="c-popup-header">Delete Users</h2>
        <div class="c-content">         
          <h3>Are you sure to delete selected users?</h3>
          <p class="alert"><strong>You are about to perform an action which can't be undone</strong></p>
          <a href="#"class="c-btn">No</a><a href="#"class="c-btn" id="delete_url">Delete</a> 
        </div>
      </div>
    </div>
<div class="hidden">
      <div id="disablePopContent" class="c-popup">
        <h2 class="c-popup-header">Disable Users</h2>
        <div class="c-content">         
          <h3>Are you sure to disable selected users?</h3>
          <p class="alert"><strong>You are about to perform an action which can't be undone</strong></p>
          <a href="#"class="c-btn">No</a><a href="#"class="c-btn" id="disable_url">Disable</a> 
        </div>
      </div>
    </div>

    $(document).ready(function()  {
    $(".delete_bulk_tests").onchange(function(e) { 
        $(".delete_bulk_tests").colorbox({inline:true, width:666});

    });

$(".disable_bulk_tests").onchange(function(e) { 
        $(".disable_bulk_tests").colorbox({inline:true, width:666});

    });
  });

関連するオプションを選択すると、対応するカラーボックスを表示したい。上記のように試しましたが、iddeletePopContentとでカラーボックスを呼び出すことができませんでしdisablePopContentた。必要なライブラリをすべて含めました。また、firebug コンソールにエラーや警告が表示されることもありません。カラーボックスを表示するのを手伝ってくれる人はいますか?事前に感謝します。

4

1 に答える 1

0

以下のコードを使用します。

$(document).ready(function()  {
    $(".delete_bulk_tests").change(function(e) { 
        $(this).colorbox({inline:true, width:666});

    });

$(".disable_bulk_tests").change(function(e) { 
        $(this).colorbox({inline:true, width:666});

    });
  });
于 2013-10-11T07:33:18.143 に答える