ga/turntable

yii2-turntable

dev-master 2017-12-04 07:41 UTC

This package is not auto-updated.

Last update: 2024-04-27 17:26:26 UTC


README

A turntable for lottery activity.

The GATurntable has two scroll types.

1.POINTER_SCROLL

pointer.gif

2.TURNTABLE_SCROLL

turntable.gif

How to install

composer require ga/turntable dev-master

How to useage

In the view file you should include following code:

<?php
use ga\turntable\TurntableWidget;
use ga\turntable\TurntableAsset;
TurntableAsset::register($this);
?>
<?= TurntableWidget::widget(['scrollType'=>TurntableWidget::TURNTABLE_SCROLL])?>

Configuration params

The configuartion is very easy,we can set the public property:

  • $deg animate degree
  • $animationTime in the other word it's the speed of animation
  • $pointerCallback js code in here.If the pointer complete animation will trigger this function.
  • $turntableCallback js code in here.If the turntable complete animation will trigger this function.
  • $scrollType self::POINTER_SCROLL or self::TURNTABLE_SCROLL
  • $pointerImagePath custom pointer image path
  • $turntableImagePath custom turntable image path
  • $turntableBGImagePath custom turntable background image path