如何调用一个jQuery Colorbox弹出在选择HTML控件的onchange事件
How to call a jQuery Colorbox pop up on the onchange event of select HTML control?
以下是我的代码片段:
<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});
});
});
我想在选择相关选项时显示相应的颜色框。我尝试了如上所述,但无法使用 id deletePopContent
和 disablePopContent
调用 Colorbox。我已经包含了所有必要的库,而且Firebug控制台中也没有错误或警告。谁能帮我显示颜色框?提前谢谢。
使用以下代码:
$(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});
});
});
相关文章:
- jQuery在两个字符串标识符之间选择HTML
- D3选择html——传递函数时,索引从1开始,而不是从0开始
- 如何减去选项两个相关的选择 HTML
- 选择 html 表中的行
- 使用jquery聚焦选择html元素
- jQuery从选项的输出字符串中选择HTML选项
- 使用 jQuery 通过 ID 属性选择 HTML 元素
- 尝试开机自检“选择”HTML表单输入时出现PHP错误
- 从单选按钮中获取值以选择 html 格式的图像
- 如何使用javascript/jquery中的某个类选择HTML页面上的所有角度字段
- 仅选择 html 节点的根项
- 有没有办法通过javascript注入自动选择HTML<选项>
- 如何选择 html <选项>其中 text=Washington
- 如何选择 HTML 表中一列的所有复选框
- 通过jquery动态创建和选择html元素
- 有没有其他方法可以选择HTML元素
- 如何调用一个jQuery Colorbox弹出在选择HTML控件的onchange事件
- 如何使用 jsoup 选择 html 文档的叶标签
- 使用 HTML 选择 (HTML) 的选择顺序出现问题
- 在选择 HTML 表单的文本输入字段后无法使日期选取器工作