JQuery Partition Plugin

Author: S.Cooray

This is a simple plugin to make an html partition editor widget.
Working on FF 3+, Chrome 5+, IE 7+, Safari

Download v0.2


onDrag Callback Example


<script type="text/javascriptsrc="jquery.min.js"></script>
<script type="text/javascriptsrc="jquery.partition.js"></script>

<script type="text/javascriptcharset="utf-8">                            

<!-- code in body -->
    <div id="partition"></div>

Parameters Usage/Code

        height: 20,
        width: 500,
        values: [25,25,25,25],
        onDrag: function(values){ show(values); },        


Parameter Name Description Default Values
values Partitions value (indicated in percentage) [ 25, 25, 25, 25]
colors Color of the bars of the rappresenting paritions ( usefull for a legend ) [ "red", "blue", "black", "green"]
height height of the partition bars (pixel) 20
width width of the widget (pixel) 500
cursorBackgroundColor Internal color of the cursors #e6e6e6
cursorBorderColor Border color of the cursors #d4d4d4
onCursorStop callback function executed when a cursor drag stops
[function parameters: actual values]
onDrag callback function executed when a cursor is dragged (continuosly while moving)
[function parameters: actual values]
onInit callback function executed when the widget is initialized
[function parameters: actual values]