【问题标题】:Pulse effect with jQueryjQuery的脉冲效果
【发布时间】:2010-06-09 19:25:24
【问题描述】:

我似乎仍然无法让脉冲图像与 jQuery 一起使用。 这是显然应该工作但没有工作的代码。

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>

</head>
<body>
<script src="jquery-1.4.2.js" type="text/javascript"></script>
<script src="jquery.pulse.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(function() {
jQuery('#waterloo').pulse({
    opacity: [0,1]
}, {
     duration: 100, // duration of EACH individual animation
     times: 3, // Will go three times through the pulse array [0,1]
     easing: 'linear', // easing function for each individual animation
     complete: function() {
         alert("I'm done pulsing!");
    }
});
</script>

<a href="#"><img src="waterloo.png" border="0" class="env" id="waterloo"/></a>
</body>
</html>

两个js文件在同一个目录,所以不知道为什么不起作用。

【问题讨论】:

  • 您有指向此页面的链接以便我们查看吗?
  • 您缺少右括号和大括号。尝试将 }); 附加到代码的末尾。并且,缩进!
  • 哇...从没想过我会那样做。我想它只是一直在逃避我。谢谢J-P
  • 为什么要单独提问? stackoverflow.com/questions/3008748/…

标签: javascript jquery html jquery-plugins


【解决方案1】:

计算右括号和方括号与左括号的数量。您尚未关闭 document.ready-statement。

【讨论】:

    猜你喜欢
    • 2012-07-09
    • 1970-01-01
    • 2014-01-20
    • 1970-01-01
    • 2015-03-20
    • 1970-01-01
    • 2017-07-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多