russ666/yii2-countdown
Yii2 的 jQuery 倒计时小部件
0.2
2017-05-31 14:46 UTC
Requires
- bower-asset/jquery.countdown: *
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-14 16:13:39 UTC
README
下载
下载 最新版本
composer
将以下行添加到您的 composer.json 中 "russ666/yii2-countdown": "*"
用法
echo \russ666\widgets\Countdown::widget([ 'id' => 'some-id', 'datetime' => date('Y-m-d H:i:s O', time() + 1000), 'format' => '\<span style=\"background: red\"\>%M</span>:%S', 'tagName' => 'span', 'events' => [ 'finish' => 'function(){location.reload()}', ], ])
参数
id
容器 ID。
datetime
倒计时的时间字符串。必须加上时区,以防止客户端-服务器时区差异问题。
format
小部件的日期时间格式(《http://hilios.github.io/jQuery.countdown/documentation.html#formatter》)
events
小部件事件(《http://hilios.github.io/jQuery.countdown/documentation.html#events》)
options
容器 HTML 选项。
tagName
容器标签名。