承接 geoffry304/yii2-widget-timer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

geoffry304/yii2-widget-timer

Composer 安装命令:

composer require geoffry304/yii2-widget-timer

包简介

Yii2 widget that displays controllable timer/stopwatch

README 文档

README

Simple timer widget for yii2-based applications

Widget timer on jquery plugin.

Displays time elapsed since timer started in format HH:MM:SS:

  • HH - elapsed hours;
  • ММ - elapsed minutes;
  • CC - elapsed seconds; It can run automatically (after page is load) or manually. It is possible to stop and reset the timer.

Installation

The preferred way to install extension is via composer. Check the composer.json for this extension's requirements and dependencies.

To install, either run

$ php composer.phar require geoffry304/yii2-widget-timer "*"

or add

"geoffry304/yii2-widget-timer": "*"

to the require section of your composer.json.

Usage

Upload all necessary components and prepare widget

use geoffry304\timer\Timer
Timer::widget([
    'options' => [
        'container' => '.timer',
        'autoStart' => true,
    ]
])

Add an html tag with class name 'timer' in any place of your html. Content of this tag will be replaced by widget.

<div class="timer"></div>

Working copy of plugin will be in global scope and can be controlled via $.fn.timer.worker. Timer will run automatically after initialization (if 'autoStart' parameter is specified) and assigned to a container with class 'timer' ('container' property).

Run the timer

    $.fn.timer.worker.go();

Plugin configuration:

  • container - html selector of timer container element (default - '.timer');
  • autoStart – whether to start timer automatically after initialization (default - true);
  • hours – start hours count from this value (default '00');
  • minutes – start minutes count from this value (default '00');
  • seconds – start seconds count from this value (default '00');
  • animate - whether to run animation when timer starts (blinking);
  • animationSpeed - speed of animation;
  • animationTimes - number of blinking;

Plugin control:

  • init(value) - initialize the timer, only displays the timer (value == false) or run timer automatically (value == true), if timer is already running this actions will stop the timer and reset all of its counters (hours, minutes, seconds);
  • go() - run the timer;
  • stop(value) - stop the timer and keep counters (hours, minutes, seconds) (value == false) or reset them (value == true);
  • flush() - reset the timer counters (hours, minutes, seconds).
  • timeAsString() - return the current time values as string.

License

yii2-widget-timer is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.

统计信息

  • 总下载量: 23
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-06-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固