jquery - bootstrap-fullscreen-select 触发 onchange 事件?
问题描述
我正在使用全屏选择选项http://craftpip.github.io/bootstrap-fullscreen-select/ 它不能触发 onchange 事件,知道吗?
<select name="select_year" id="select_year" class="form-control mobileSelect">
<option value='abc'> abc </option>
</select>
$(document).ready(function()
{
$('#select_year').on('change', function() {
alert( "asdaS" );
})
});
感谢@Justinas。我成功触发了 onchange 事件。这是我所做的:
添加以下代码:
onClose: function(){
alert('onClose: '+$(this).val());
},
onOpen: function(){
alert('onOpen: '+this.val());
}
里面 :
$('.mobileSelect').mobileSelect({
animation: 'scale',
animationSpeed: 400,
});
变得 :
$('.mobileSelect').mobileSelect({
animation: 'scale',
animationSpeed: 400,
onClose: function(){
alert('onClose: '+$(this).val());
},
onOpen: function(){
alert('onOpen: '+this.val());
}
});
解决方案
推荐阅读
- elasticsearch - 在 Elasticsearch 中使用通配符进行不区分大小写的搜索
- android - 应用程序启动时出现错误“调用 AppRegistery.runApplication 时出错”
- python - 'numpy.float64' 对象不能解释为整数,但我无法确定它在哪里要求整数
- javascript - 用 html 内容中的 iframe 替换 youtube 链接?
- junit - 需要 convertStringToDocument 方法的测试用例
- postgresql-9.5 - 如何从 /var/lib/postgresql/9.5/main/base/ 目录中恢复 Postgresql 数据库表?
- ios - Xamarin iOS 按钮不起作用
- java - 有没有办法在我的测试自动化套件目录中自动更新 chromedriver?
- ios - 如何检查 UIViewController 类是定义为 SDK 的一部分还是用户定义的?
- java - 子类映射时的休眠问题 - 实例化默认元组