Skip to content

Instantly share code, notes, and snippets.

@jpederson
Last active August 29, 2015 13:57
Show Gist options
  • Save jpederson/9496731 to your computer and use it in GitHub Desktop.
Save jpederson/9496731 to your computer and use it in GitHub Desktop.
Accrue.js callback example.
$( selector ).accrue({
callback: function( elem, data ){
if ( data===0 ) {
// ERROR FUNCTIONALITY HERE
} else {
// SUCCESS FUNCTIONALITY HERE
// find elements inside the calculator div, and do things with them.
elem.find( ".results:hidden" ).slideDown( 300 );
// dump the calculation info to console to learn how to use it.
console.log( data );
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment