ie6下的max-width;max-height;min-width;min-height;处理
CSS
img {
max-width:200px;
max-height:132px;
min-width:100px;
min-height:100px;
cursor:pointer;
border:1px dashed #4E6973;
padding: 3px;
zoom:expression( function(elm) {
if(elm.width>0 && elm.height>0)
{
var max_width = 200;
var max_height = 132;
var min_width = 100;
var min_height = 100;
//min
if(elm.width/elm.height<=min_width/min_height)
{
if(elm.width<min_width)
{
elm.width=min_width;
elm.height=(elm.height/min_width)*elm.width;
}
}
else
{
if(elm.height<min_height)
{
elm.height=min_height;
elm.width=(elm.width/min_height)*elm.height;
}
}
//max
if(elm.width/elm.height>=max_width/max_height)
{
if(elm.width>max_width)
{
elm.width=max_width;
elm.height=(elm.height*max_width)/elm.width;
}
}
else
{
if(elm.height>max_height)
{
elm.height=max_height;
elm.width=(elm.width*max_height)/elm.height;
}
}
elm.style.zoom = '1';
}
}(this));
}