Fuel UX wizard example
时间: 2023-07-25 13:03:35 浏览: 88
Wizard1的使用例子
Sure, here's an example of how to use the Fuel UX wizard component:
HTML:
```
<div class="wizard" data-initialize="wizard" id="myWizard">
<ul class="steps">
<li data-step="1" class="active">Step 1<span class="chevron"></span></li>
<li data-step="2">Step 2<span class="chevron"></span></li>
<li data-step="3">Step 3<span class="chevron"></span></li>
</ul>
<div class="step-content">
<div data-step="1" class="step-pane active">
Step 1 Content
</div>
<div data-step="2" class="step-pane">
Step 2 Content
</div>
<div data-step="3" class="step-pane">
Step 3 Content
</div>
</div>
<div class="actions">
<button type="button" class="btn btn-default btn-prev"><span class="glyphicon glyphicon-chevron-left"></span>Prev</button>
<button type="button" class="btn btn-default btn-next" data-last="Finish">Next<span class="glyphicon glyphicon-chevron-right"></span></button>
</div>
</div>
```
JavaScript:
```
$('#myWizard').wizard();
$('#myWizard').on('changed.fu.wizard', function (evt, data) {
console.log(data.step);
});
```
This example creates a wizard with 3 steps and provides basic functionality to move between steps. The `changed.fu.wizard` event is triggered when the step changes, and you can access the current step number through the `data.step` parameter.
阅读全文