【问题标题】:Jquery Trigger Working Chrome, IE but not FirefoxJquery Trigger 工作 Chrome, IE 但不是 Firefox
【发布时间】:2014-07-24 20:29:28
【问题描述】:

目前我的代码将在 chrome 和 IE 中触发,但在 Firefox 中什么都没有。我在 FireFox 中添加了 console.log 和繁荣,代码到达那里,所以没有添加 CSS 吗?

jQuery("#eigth").waypoint(function(direction) {
    console.log('got here');
    jQuery("#globe").css({'filter:' : 'none', '-webkit-filter' : 'grayscale(0%)'});
});

【问题讨论】:

  • -moz-filter?? -webkit webkit 浏览器(所以没有 Firefox)。 filter 是针对 IE 的? (如我错了请纠正我)。所以你需要为 Firefox 添加一个 CSS。#
  • webkit-filter 针对基于 Webkit 的浏览器 - 对于 Firefox,请参阅 this answer

标签: javascript jquery


【解决方案1】:

检查您的代码

jQuery("#eigth").waypoint(function(direction) {
    console.log('got here');
    jQuery("#globe").css({'filter:' : 'none', '-webkit-filter' : 'grayscale(0%)'});
});

语法错误(:)

{'filter' : 'none' instead of {'filter:' : 'none'

【讨论】:

  • 你的上帝。说够了:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-07-11
  • 2011-10-15
  • 2012-11-03
  • 1970-01-01
  • 2015-02-12
  • 1970-01-01
  • 2012-03-24
相关资源
最近更新 更多