Added custom jquery plugin jquery.cuteform.js.
[wolnelektury.git] / media / js / jquery.cuteform.js
diff --git a/media/js/jquery.cuteform.js b/media/js/jquery.cuteform.js
new file mode 100644 (file)
index 0000000..7993634
--- /dev/null
@@ -0,0 +1,13 @@
+(function($) {
+    $.fn.cuteform = function() {
+        $('form.cuteform', this).each(function(index) {
+            var formLabels = $('label', this)
+            var maxWidth = 0;
+            
+            formLabels.each(function() {
+                maxWidth = max(maxWidth, this);
+            });
+            formLabels.width(maxWidth);
+        });
+    };
+})(jQuery)
\ No newline at end of file