<img id="bxg" class="img-thumbnail img-responsive m" src="${contextPath}/resources/${v.imgurl}"> <script type="text/javascript"> $(document).ready(function() { $(window).resize(function(){ $("img[id='bxg']").each(function(){ $(this).css("height","120px"); }); }); //正常加载后 $("img[id='bxg']").each(function(){ $(this).css("height","120px"); }); }); </script>