【发布时间】:2016-07-20 12:30:39
【问题描述】:
我正在将此插件用于计时器https://github.com/wimbarelds/TimeCircles 最适合我需要的东西。但总是在这里但是:D
我想让这个计时器更好地工作,就像当我点击暂停来暂停而不是只暂停圆圈的动画以及停止的时间一样。所以这是我的代码
$(".example.stopwatch").TimeCircles({
"animation": "smooth",
"bg_width": 1.2,
"fg_width": 0.1,
"circle_bg_color": "#60686F",
"start": false,
"time": {
"Days": {
"text": "Days",
"color": "#FFCC66",
"show": true
},
"Hours": {
"text": "Hours",
"color": "#99CCFF",
"show": true
},
"Minutes": {
"text": "Minutes",
"color": "#BBFFBB",
"show": true
},
"Seconds": {
"text": "Seconds",
"color": "#FF9999",
"show": true
}
}
});
$(".start").click(function () {
$(".example.stopwatch").TimeCircles().start();
});
$(".stop").click(function () {
$(".example.stopwatch").TimeCircles().stop();
});
$(".restart").click(function () {
$(".example.stopwatch").TimeCircles().restart();
});
/**
* This element is created inside your target element
* It is used so that your own element will not need to be altered
**/
.time_circles {
position: relative;
width: 100%;
height: 100%;
}
/**
* This is all the elements used to house all text used
* in time circles
**/
.time_circles > div {
position: absolute;
text-align: center;
}
/**
* Titles (Days, Hours, etc)
**/
.time_circles > div > h4 {
margin: 0px;
padding: 0px;
text-align: center;
text-transform: uppercase;
font-family: 'Century Gothic', Arial;
}
/**
* Time numbers, ie: 12
**/
.time_circles > div > span {
display: block;
width: 100%;
text-align: center;
font-family: 'Century Gothic', Arial;
font-size: 300%;
margin-top: 0.4em;
font-weight: bold;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://git.wimbarelds.nl/TimeCircles/inc/TimeCircles.js"></script>
<div class="panel-body">
<div class="example stopwatch" data-date="2016-07-20 00:00:00" style="width: 100%;"></div>
<button class="btn btn-success btn-small start">Start</button>
<button class="btn btn-danger btn-small stop">Stop</button>
<button class="btn btn-info btn-small restart">Restart</button>
</div>
【问题讨论】:
-
是的,它正在按预期工作......
-
前。 2h 20min 20sec 在 2h 50min 10sec 点击暂停 2h 50min 10sec 在 20min 后点击恢复 它需要与 prevision 相同 2h 50min 10sec 不显示我 3h 10min 20sec 不起作用,因为我想尝试它像暂停 30 秒然后点击开始后
-
是的,我现在看到了这个问题。
标签: javascript jquery timer prototype