This simple widget allows to trigger an action after a given time in seconds...
$this->widget('ext.ecountdownaction.ECountdownAction', array( 'seconds'=>8, //8 seconds 'action'=>'{alert("hello world!")}', //action code... ) );
Another example using bootstrap extension, auto opening a modal window:
$this->widget('ext.ecountdownaction.ECountdownAction', array( 'seconds'=>3, 'action'=>"$('#modal').bootModal('open');", ) );
Total 3 comments
Hi,
One of a usage that I can think of is for screen lock, any others? Although, I only have the idea not implementation ;)
Is that possible to change the 'seconds' dynamically?
My idea is to lock the screen if no activity in 5 seconds, unless the user doing something.
Thanks and good extension anyway!
Hi!, of course you can do it using pure javascript code. This widget is really basic, is just a simple yii-widget implementation, you can use it as reference to create another widget...
Maybe a good improvement could be reading action from a model ;)
What advantages does this have over a pure JavaScript solution?
Leave a comment
Please login to leave your comment.