javascript - Implementating wizard (jquery.steps) in Yii2 framework -
i implement wizard (with forms) application. therefore, use jquery.steps (which can find here.
i have created assetbundle containing correct js files
namespace app\assets; use yii\web\assetbundle; class wizardasset extends assetbundle { public $basepath = '@webroot'; public $baseurl = '@web'; public $css = [ 'css/site.css', 'css/smart_wizard.css', 'css/jquery.steps.css', ]; public $js = [ 'js/jquery.steps.min.js', ]; public $depends = [ 'yii\web\yiiasset', 'yii\bootstrap\bootstrapasset', ]; }
and have following code in view:
<?php use app\assets\wizardasset; wizardasset::register($this); ?> <div id="example-basic"> <h3>keyboard</h3> <section> <p>try keyboard navigation clicking arrow left or right!</p> </section> <h3>effects</h3> <section> <p>wonderful transition effects.</p> </section> <h3>pager</h3> <section> <p>the next , previous buttons navigate through content.</p> </section> </div> <script> $("#example-basic").steps({ headertag: "h3", bodytag: "section", transitioneffect: "slideleft", autofocus: true }); </script>
this not seem work: guess javascript files should loaded before .. @ end of html file, yii forces script @ end of file. there way overcome this? or correct mistake?
Comments
Post a Comment