Monday, February 14, 2011

JCalculator - A calculator plugin for jQuery

Welcome and thanks for visiting! This is my first blog for the first plugin i made for jQuery. In a nutshell, jCalculator provides simple yet customizable calculator for a web application.

Download
JCalculator v1.0


Usage
JCalculator Basic Usage
$().ready(function() {
    $('#example1').calculator();
});
 

JCalculator Options
defaultOpen: defaults to true
  the default state of calculator when it is loaded.
title: defaults to 'Calculator'
  the title of the calculator.
accuracy: defaults to 12
  the number of digits to accept as input for the calculator.
width: defaults to 164,
  the width of calculator.
height: defaults to 180
  the height of calculator
movable: defaults to  false
  whether the calculator is draggable or not [works only if jQuery UI is included in the page]
resizable
: defaults to false
  whether the calculator is resizable or not [works only if jQuery UI is included in the page]


JCalculator Events
buttonPressed: Supply a callback function to handle the event when a button is pressed by user
$( ".selector" ).calculator({
   buttonPressed: function(calc, button) { ... }
});
displayChanged: Supply a callback function to handle the event when the display of calculator is changed
$( ".selector" ).calculator({
   displayChanged: function(calc, button) { ... }
});

JCalculator Methods
No methods available yet


Special Considerations

For best experience please use this plugin with the jQuery UI included on the page. The plugin is not tested fully yet. Please report the issues here in case you found any bugs in the plugin.