javascript - 使用 jQuery 实现脉冲效果

标签 javascript jquery html jquery-plugins

我似乎仍然无法让脉冲图像与 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文件都在同一个目录下,所以我不知道为什么它不起作用。

最佳答案

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

关于javascript - 使用 jQuery 实现脉冲效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3009179/

相关文章:

javascript - 使用 JavaScript 打印 HTML Object 标签的内容

jquery - 如何设置导航以更改某些点的字体颜色?

javascript - DIV 的可编辑内容无法正常工作

javascript - Ajax 响应作为映射对象绑定(bind)到 Html

javascript - 在 Raphael JS 中创建脉动(循环)背景的最简单方法?

javascript - 具有大数据的 jQuery 数据表和 Grails

javascript - 如何创建热键

javascript - 展开/折叠 jQuery ui mobile 中的所有列表元素

javascript - 如何以 HTML 格式输出 XML

php - JQGrid:通过post获取JQGrid中的多个选中行值