StatefulJS v1.1


Introduction

StatefulJS is a plugin depends on jQuery to show manually the state of processes by <button>s (or visible <any>). This comes in handy on slow connections or AJAX requests. This has deprecated from Bootstrap since since v3.3.5 but if you still need it, clap your hands now.

Features

  • Light-weight but powerful.
  • Doesn't harm to your stylings like other plugins.
  • Usable with Twitter-Bootstrap. (Adds class disabled; so use default or style yourself.)
  • Compatible with WordPress. (Used jQuery)

Usage

All you have to do is to set data-loading-text to a prefered text or just leave blank to show default "Loading...". Delay of the toggle can be also set in milliseconds with data-loading-delay but it's optional with default 3000ms (3 secs).

Note: attribute data-loading-text="" is a must.

From v1.1 you can set global parameters:

  • text (string) : Text to display on stateful
  • delay (integer) : Time to hold stateful
  • disabled (boolean) : Disable gloabally if true

within $(document).stateful({parameter:value}).

Basic Examples

<button data-loading-text="">Click me</button>
<button data-loading-text="Wait for it">Click me too</button>
<div data-loading-text="Legendary" data-loading-delay="500">Click me as well</div>
Click me as well