I have problem with filter in Prestashop. Originally in blocklayered.js exist that code:

我在Prestashop过滤器有问题。最初在blocklayered.js中存在该代码:

    $(document).on('click', '#layered_form select',function(e) {
      reloadContent(true);
    });

However this code is wrong, because when I click on select - function reloadContent() is started. I want to start that function when user click on option in dropdown list. I changed the code:

但是这段代码是错误的,因为当我点击select - function reloadContent()时就启动了。我想在用户点击下拉列表中的选项时启动该功能。我更改了代码:

$(document).on('click', '#layered_form select option', function(e) {
    reloadContent(true);
});

Now, my filter work correctly in firefox but doesn't work in chrome. What is the reason?

现在,我的过滤器在Firefox中正常工作,但在chrome中不起作用。是什么原因?

1 个解决方案

#1


You should instead just use the change event of select element:

您应该只使用select元素的change事件:

$(document).on('change', '#layered_form select',function(e) {
    reloadContent(true);
});

更多相关文章

  1. arcgis api for js入门开发系列十 自定义Navigation控件样式风格
  2. 五十行javascript代码实现简单的双向数据绑定
  3. 在内容可编辑DIV中的选定文本周围包装bb代码
  4. 常用验证JS代码基础及实例
  5. 试着在我的javascript代码中理解“this”(一件事有效,另一件没有)
  6. 代码点火-如何从控制器返回Json响应
  7. 小弟初学网页(javascript),看不懂下面的代码。但又要完成任务 各位
  8. 使用jquery在textarea中的颜色代码
  9. 为什么我的javascript/jquery代码不能像预期的那样工作?

随机推荐

  1. 解决Could not find method android() fo
  2. Android禁止横屏竖屏切换
  3. 改变android程序head样式
  4. android的Notification折叠
  5. [ZZ]Android UI Automated Testing
  6. Android初小试---一分钟傻瓜式打包
  7. android studio 提示no android sdk foun
  8. Robotium Recorder的初试
  9. Android各种花式酷炫自定义控件开源库集
  10. 关于RelativeLayout的一点经验