jQuery (v1.10.2 is included with the example)
Once you've added jquery.nanoform.js and jquery.nanoform.css to the list of script and style files that are loaded in your html page,
simply call the nanoform method on an empty element on the page:
$('#myform').nanoform(options);
In order for the nanoform to work properly, the only mandatory parameter is fn which specifies the function you want the form to execute when clicking the submit button.
| Name | Type | Default | Description |
|---|---|---|---|
| fn | function | none | Function to be execute when clicking submit |
| placeholder | string | empty | Placeholder while there's no input in the form |
| submit_html | html | empty | HTML code you'd like to be appended to the submit button |
| overlay_html | html | empty | HTML code you'd like to be appended to the overlay element |
| overlay_html | html | empty | HTML code you'd like to be appended to the overlay element |
| to_w | string | none | The width to stretch to in Input mode (rem, em, px, pt). If not specified, the form remains the same width as in Engage mode. |
| to_l | string | none | The amount of units to move left in Input mode (rem, em, px, pt). If not specified, the form remains the same position as in Engage mode. |
This example uses the elShaker extensions by Leandigo to visualize an erroneous form input.
$('#contact').nanoform({
fn: submitEmailFunction,
to_w: '7em',
to_l: '3.5em',
placeholder: 'Your email address',
overlay_html: 'Notify me when ready!',
submit_html: '<img style="margin-top: 80%;" src="img/submit.png">'
});
Copyright (c) 2013, Leandigo (www.leandigo.com)
Released under the MIT License. See the LICENSE file for details.