Min-width and max-width with jQuery

How to emulate for ie6?

+2


source to share


2 answers


to emulate max-width:

var maxWidth = 300;    
if ( $('SELECTOR').width() > maxWidth ) $('SELECTOR').width(maxWidth);

      



the same can be applied for width, height, min and max with small adjustments.

+6


source


By simply adding anwser to the codebugger, you can also place it in an external JS file or JS block that is only shown in IE6 via conditional comments.



+1


source







All Articles