Skip to content

Instantly share code, notes, and snippets.

@AlexeyMK
Last active August 29, 2015 13:56
Show Gist options
  • Save AlexeyMK/8970958 to your computer and use it in GitHub Desktop.
Save AlexeyMK/8970958 to your computer and use it in GitHub Desktop.
simply.js counter
var count = parseInt(localStorage.getItem('count')) || 0;
simply.on('singleClick', function(e) {
if (e.button === 'up') {
count+=1; simply.subtitle(count);
} else if (e.button === 'down') {
count-=1; simply.subtitle(count); }
localStorage.setItem('count', count);
});
simply.text({ title: 'Counter', subtitle: count });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment