Last active
August 29, 2015 13:57
-
-
Save jpederson/9496731 to your computer and use it in GitHub Desktop.
Accrue.js callback example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( 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