Here is the code snippet in question:
$('#ad img').each(function(){
if($(this).width() > 125){
$(this).height('auto');
$(this).width(125);
}
});
While this code works correctly in Firefox, it seems to have issues in Chrome. The images within the #ad
element are being constrained by height, but if they exceed a certain width, I need to restrict that as well. Is there a more universal approach that would be compatible with all browsers?
The specific HTML for the image is provided below:
<img src='http://easyuniv.com/img/ads/".$ad['img']."' height='40px'>