Incorporating ZeroClipboard, I have implemented the following code to alter the text and class of my 'copy to clipboard button' by modifying the innerHTML. Upon clicking, this triggers a smooth class transition animation.
client.on( "complete", function(client, args) {
this.innerHTML = 'Copied to Clipboard';
$( this ).removeClass( "btn-info" ).addClass( "btn-success", 357 );
});
I am looking for a solution that would enable me to make this class and innerHTML modification temporary. For instance, changing the class (to btn-success) only for a few seconds to indicate that the button was clicked, then automatically reverting back to its original class (btn-info). Also, removing the additional innerHTML = 'Copied to Clipboard'.
The desired class transition sequence would be: btn-info > btn-success > btn-info. Additionally, it should revert the innerHTML back to its original content (as each button has different innerHTML).
I attempted experimenting with toggleClass without much success so far.