Wednesday, May 9, 2012

Smoke.js - Javascript Alert System Replacement

Smoke.js is a replacement of browser's default alert system for Javascript. If you want to standardize Javascript alert box across different browsers and platforms, Smoke.js is the plugin you are looking for. Smoke.js is a lightweight and flexible Javascript plugin that does just that - replace the existing alert, confirm, prompt and a new addition - signal which display an alert box and hide it after a few seconds. It's fully made with HTML and CSS3 so you will able to style it up and make a custom alert box that visually matched with your website.


Details





  • Website/Author  
    Demo  
    Download

  • RequirementCSS3 Support
  • CompatibilityMost Browsers including IE6 (Except CSS3 Visual Effect)
  • LicenseMIT License




Features



  • Signal: Message appear for a few seconds

  • Alert: Normal alert box

  • Confirm: Alert box with Yes & No buttons

  • Prompt: Alert box with input field.

  • Support callback event

  • Lightweight, and easy to skin

  • Work on all browsers including Mobile platform (IE6 usable, no animation)


Example


Alert



smoke.alert('This is a normal alert... nothing fancy', {}, function(){
// oh what now?
});

Confirm



smoke.confirm('You are about to destroy everything. Are you sure?',function(e){
if (e){
smoke.alert('OK pressed');
}else{
smoke.alert('CANCEL pressed');
}
});

Prompt



smoke.prompt('what's my name?',function(e){
if (e){
smoke.alert('my name is '+e);
}else{
smoke.alert('no');
}
});

Signal



smoke.signal('this goes away after a few seconds... 5 seconds in fact');

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.