[PLUGINS] +crayons
[lhc/web/clavette_www.git] / www / plugins / crayons / js / jquery.px.js
diff --git a/www/plugins/crayons/js/jquery.px.js b/www/plugins/crayons/js/jquery.px.js
new file mode 100644 (file)
index 0000000..e6c195d
--- /dev/null
@@ -0,0 +1,18 @@
+// Ce plugin permet de recuperer css(fontSize) en px meme sous MSIE
+(function($){
+       $.fn.px = function(prop) {
+               var val;
+               if($.browser.msie) {
+                       $('<span><\/span>')
+                       .css({display: 'block', width: '1em'})
+                       .appendTo(this[0])
+                       .each(function(){
+                               val = parseInt($(this).width()) + 'px';
+                       })
+                       .remove();
+               } else {
+                       val = this.css(prop);
+               }
+               return val;
+       };
+})(jQuery);