我下载了这个jquery插件:http://harshen.github.io/jquery-countdownTimer/
特别是使用从时间设置为仅分钟的反向倒计时到零
计时器。
我很确定我正确地遵循了说明,但该插件不起作用。我以前从未使用过 jQuery 或插件,所以我不确定我是否遗漏了某些内容或只是做了一些完全错误的事情(或两者兼而有之)。
我的 Javascript 测试警报确实运行了。
我将附上我的代码供大家查看。不确定它是否与我的文件路径有关,但我也附上了该图像。请告诉我可能导致该问题的原因以及如何解决。谢谢。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="timer/LIB/jquery-2.0.3.js"></script>
<script type="text/javascript" src="timer/jquery.countdownTimer.js"></script>
<link rel="stylesheet" type="text/css" href="timer/CSS/jquery.countdownTimer.css"/>
<script type="text/javascript">
alert("working");
</script>
</head>
<body>
<script type="text/javascript">
alert("tester");
</script>
<div id="main"><span id="m_timer"></span></div>
<script type="text/javascript">
$(function()
{
$("#m_timer").countdowntimer({
minutes : 2‚
size : "lg"
});
})
</script>
</body>
</html>
这是我的项目文件夹的图片,其中包含文件:
最佳答案
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="timer/LIB/jquery-2.0.3.js"></script>
<script type="text/javascript" src="timer/jquery.countdownTimer.js"></script>
<link rel="stylesheet" type="text/css" href="timer/CSS/jquery.countdownTimer.css"/>
<script type="text/javascript">
alert("working");
</script>
</head>
<body>
<script type="text/javascript">
alert("tester");
</script>
<div id="main"><span id="m_timer"></span></div>
<script type="text/javascript">
$(function()
{
$("#m_timer").countdowntimer({
minutes : 2‚
size : "lg"
});
})
</script>
</body>
</html>
关于javascript - Jquery countdownTimer 插件不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40500544/