我在我的网站上使用 Flipclock,我的问题是……如何在一个页面中放置 1 个以上的 Flipclock?
如果我尝试复制它们,它不起作用(如复制粘贴 div 标签并重命名它们)
知道如何在网页中放置超过 1 个翻转时钟吗?
这就是我得到的:http: //i58.tinypic.com/k3xk0p.png
这是我的代码:
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link rel="stylesheet" href="../includes/flipclock.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="../includes/flipclock.js"></script>
<script type="text/javascript">
var clock;
$(document).ready(function () {
var clock;
clock = $('.clock').FlipClock({
clockFace: 'DailyCounter',
autoStart: false,
callbacks: {
stop: function () {
$('.message').html('The clock has stopped!')
}
}
});
clock.setTime(65000); /*60 = 1 Minute*/
clock.setCountdown(true);
clock.start();
});
</script>
<style type="text/css">
section
{
background-color:rgba(0, 0, 0, 0.45);
width:900px;
padding-top:5px;
margin-left:10px;
border:1px solid rgb(16, 16, 16);
}
footer
{
position:relative;
top:25px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" Runat="Server">
<div class="clock" style="margin:2em;"></div>
<div class="message"></div>
<div class="clock" style="margin:2em;"></div>
<div class="message"></div>
</asp:Content>