Skip to content

Instantly share code, notes, and snippets.

@egorvinogradov
Created March 17, 2013 14:17
Show Gist options
  • Save egorvinogradov/5181706 to your computer and use it in GitHub Desktop.
Save egorvinogradov/5181706 to your computer and use it in GitHub Desktop.
// Плагин
$.fn.extend({
fixFilterWidth: function(){
this.hide().each(function(i, el){
var input = $(el);
var margins = +input.css('marginLeft').replace(/px$/, '') +
+input.css('marginRight').replace(/px$/, '') +
+input.css('borderLeftWidth').replace(/px$/, '') +
+input.css('borderRightWidth').replace(/px$/, '');
var width = input.parent().width() - margins;
input.width(width);
}).show();
}
});
// Инициализация
$('.tablesorter-filter').fixFilterWidth();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment