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

media

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.

The data-media option takes precidence over data-wimpyButton for the media file.

"track.mp3"

optional

string

playText

The text to display when playing.

"play"

optional

string

pauseText

The text to display when paused.

"pause"

optional

string

loadingText

The text to display when loading (while data is being buffered).

"loading"

optional

string

width1

The width of the button.

100

optional

integer

height1

The height of the button.

40

optional

integer

textSize

Sets the size of the text in the button.

12

optional

number

volume

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

1 Width and height defined as an option take presidence over style-based width and height definitions.  See "Button Styling" for more info.