[PLUGINS] +crayons
[lhc/web/clavette_www.git] / www / plugins / crayons / js / jquery.px.js
1 // Ce plugin permet de recuperer css(fontSize) en px meme sous MSIE
2 (function($){
3 $.fn.px = function(prop) {
4 var val;
5 if($.browser.msie) {
6 $('<span><\/span>')
7 .css({display: 'block', width: '1em'})
8 .appendTo(this[0])
9 .each(function(){
10 val = parseInt($(this).width()) + 'px';
11 })
12 .remove();
13 } else {
14 val = this.css(prop);
15 }
16 return val;
17 };
18 })(jQuery);