Wimpy Button Options
Below are quick examples for how to define options with HTML or Javascript.
HTML Button Instance Example
Button Instance options are prefixed with "data-".
<div data-wimpyButton="track.mp3" data-playText="play" data-pauseText="pause"></div>
Javascript Example
No prefix needed, just use the option name.
wimpyButton.activate({media:"track.mp3", playText:"play", pauseText:"pause"});
NOTES
• Please review "Value Types" for important info regarding "type"
(string, number, boolean, etc.)
Option | Description | Example | Default | Type |
A URL to an MP3 file. As a convienience, you can assign data-wimpybutton="track.mp3", which is the same as defining the data-media.
|
"track.mp3" |
optional |
string |
|
The text to display when playing. |
"play" |
optional |
string |
|
The text to display when paused. |
"pause" |
optional |
string |
|
The text to display when loading (while data is being buffered). |
"loading" |
optional |
string |
|
The width of the button. |
100 |
optional |
integer |
|
height1 | The height of the button. |
40 |
optional |
integer |
Sets the size of the text in the button. |
12 |
optional |
number |
|
Sets the button's volume. NOTE: Some mobile devices do not honor setting the volume programatically. Click here to learn more. |
0.5 |
optional |
number from 0.0 to 1.0 |
|
Loops the track continuously. |
true |
optional |
boolean |
|
Limits the time the track can play to X number of seconds. |
30 |
optional |
number |
1 Width and height defined as an option take presidence over style-based width and height definitions. See "Button Styling" for more info.