::CHE№::
- ::CHE№:: 回答了问题 Yii2消息提示如何实现3秒自动关闭
controller:
Yii::$app->getSession()->setFlash('success', '1234');html:
<?php $this->beginBlock('auto_close_alert'); ?>$(function() { setTimeout(function() { $('.alert').slideUp(500); //方法一 //$('.close').close();//方法二 }, 1000); });
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['auto_close_alert'], \yii\web\View::POS_END); ?> - ::CHE№:: 赞了评论
到今天为止,在这里见过最完善和强大的框架了