1.1.4 • Published 1 year ago

jquery.steps v1.1.4

Weekly downloads
471
License
MIT
Repository
github
Last release
1 year ago

jquery-steps

npm License: MIT npm npm

A simple, lightweight jQuery step wizard plugin.

Features

  • Easy configuration
  • Lightweight (2KB gzipped)
  • Works in all major browsers including IE11+

Compatibility

IE11+, Edge, Chrome, Firefox, Opera, Safari

Installation

NPM

npm install jquery.steps

Github

git clone http://github.com/oguzhanoya/jquery-steps.git

CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.steps@1.1.2/dist/jquery-steps.min.css">
<script src="https://cdn.jsdelivr.net/npm/jquery.steps@1.1.2/dist/jquery-steps.min.js"></script>

Setup

Include plugin stylesheets.

<link rel="stylesheet" href="css/jquery-steps.css">

Make necessary markup for wizard. That's all, you don't need to do anything else.

<div class="step-app" id="demo">
  <ul class="step-steps">
    <li data-step-target="step1">Step 1</li>
    <li data-step-target="step2">Step 2</li>
    <li data-step-target="step3">Step 3</li>
  </ul>
  <div class="step-content">
    <div class="step-tab-panel" data-step="step1">
      ...
    </div>
    <div class="step-tab-panel" data-step="step2">
      ...
    </div>
    <div class="step-tab-panel" data-step="step3">
      ...
    </div>
  </div>
  <div class="step-footer">
    <button data-step-action="prev" class="step-btn">Previous</button>
    <button data-step-action="next" class="step-btn">Next</button>
    <button data-step-action="finish" class="step-btn">Finish</button>
  </div>
</div>

Include plugin and dependeces. jQuery is the only dependency, make sure to include it.

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="js/jquery-steps.js"></script>

Init plugin with choosen options.

<script>
  $('#demo').steps({
    onFinish: function () { alert('complete'); }
  });
</script>

Configuration

SettingDefault ValueDescription
startAt0Starts wizard at specifed step number.
showBackButtontrueIndicates whether the back button will be visible.
showFooterButtonstrueIndicates whether the footer buttons will be visible.
stepSelector.step-stepsThe selector used for each step.
contentSelector.step-contentThe selector used for the step content.
footerSelector.step-footerThe selector used for the buttons.
activeClassactiveThe class used when a step is active.
doneClassdoneThe class used when a step is done.
errorClasserrorThe class used when an error occurs in a step.
onInitfunction(){}Fired when plugin is initialized.
onChangefunction(currentIndex, newIndex, stepDirection){return true;}Fired when plugin step changed.
onFinishfunction(){}Fired when plugin wizard finished.
onDestroyfunction(){}Fired when plugin destroy.

Methods

NameDescription
destoryDestroy the plugin instance.
nextGoes to the next step.
prevGoes to the previous step.
finishTrigger the onFinish event.
getStepIndexGets the current step index.(start from 0)
getMaxStepIndexGets the max step index.
setStepIndexSets the step index.

License

MIT

1.1.4

1 year ago

1.1.3

2 years ago

1.1.2

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

7 years ago