我正在使用插件 Portfilter 。它可以在 IE、FF 中使用 select 标签,但不能在 Chrome 中使用。有谁知道出了什么问题吗?
JS
$('select#car_value').change(function(){
$.fn.portfilter(this.options[this.selectedIndex]);
});
HTML
<select id="car_value">
<option value="abarth" data-toggle="portfilter" data-target="abarth">Abarth</option>
</select>
ps。我有超过 30 个选项标签,这只是一个例子
<强> Example
最佳答案
我将 javascript 部分更改为:
$('select#car_value').change(function(){
$(":selected", this).portfilter('filter');
});
这也包含在插件初始化部分中,并且它有效。
关于javascript - 功能在 Chrome 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47223167/