以下是我的在線測試考試項目中計時器的代碼。當計時器結束時,我想重定向到finish.php
。我怎樣才能做到這一點?倒計時結束後重定向到PHP頁面
<!doctype html>
<html>
<head>
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css"
rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans'
rel='stylesheet' type='text/css'>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="src/jquery.missofis-countdown.js"></script>
<script type="text/javascript">
$(function() {
// default setup
$('#timer-countdown').countdown({
from: 60, // 3 minutes (3*60)
to: 0, // stop at zero
movingUnit: 1000, // 1000 for 1 second increment/decrements
timerEnd: undefined,
outputPattern: '$hour : $minute : $second',
autostart: true
});
// count up
$('#timer-countup').countdown({
from: 0,
to: 180
});
// count in-between
$('#timer-countinbetween').countdown({
from: 30,
to: 20
});
// counter callback
$('#timer-countercallback').countdown({
from: 10,
to: 0,
timerEnd: function() {
this.animate({ 'opacity':.5 }, 500).css({ 'text-
decoration':'line-through' });
}
});
// changed output patterns
$('#timer-outputpattern').countdown({
outputPattern: '$day Days $hour Hours $minute Miniuts $second Seconds',
from: 60 * 60 * 24 * 3
});
});
</script>
</head>
<body>
<p class="timer-holder"><span id="timer-countdown"></span></p>
</body>
</html>
以下是我的在線考試考試項目中計時器的代碼。當計時器結束時,我想重定向到finish.php
。我怎樣才能做到這一點?
'window.location.assign( 'finish.php')' –
我應該把上面的代碼? – sri
在倒計時結束時爲插件調用的任何屬性提供的匿名函數。 –