背景: Why does image height get so large in this example? 即使我应用了问题中的修复程序,问题仍然出现:
您认为问题出在表现层还是服务端?我想我可以解决这个问题但是有很多组件并且可能有一个 super 简单的解决方案,它似乎只是将图像高度设置为 auto
但它似乎不工作。你能建议采取什么措施吗? HTML 是
<!-- Main Images -->
<div class="item_image" style="height:auto">
<div class="item_arrow_left" style="height: 428px">
<i class="sprite_vi_arrow_left" style="margin-top: 200px"></i>
</div>
<div class="image_container">
<img src="http://lh5.ggpht.com/v9WiErUPsBsOtHk9cKnA_ag3glBmZ9QG1D0wGC0DrUCgAJmyasVGt6njzCK2yUX4YjVa8TTeP8h8EmuCXlEgltt0R5g=s640" id="main_image_0" alt="Premium Food United Kingdom"Waleed Babar Khan" title="Click for next image">
<img src="http://lh5.ggpht.com/v9WiErUPsBsOtHk9cKnA_ag3glBmZ9QG1D0wGC0DrUCgAJmyasVGt6njzCK2yUX4YjVa8TTeP8h8EmuCXlEgltt0R5g" class="hidden" id="main_image_1" alt="Premium Food United Kingdom"Waleed Babar Khan" class="thumb_image_single" title="Click for next image">
<img src="http://lh4.ggpht.com/Y2IUX7VAMmxVGlf2B-3Y3TlKZ_GqgpqIX6HpyYDp3dwrI9N3Lf3QZrjGHEKhVybMxn6ke5xLVjkwBkg1frdJihxt" class="hidden" id="main_image_2" alt="Premium Food United Kingdom"Waleed Babar Khan" class="thumb_image_single" title="Click for next image">
<img src="http://lh5.ggpht.com/CyuBJ4J3-CzndvoJ3q59tz29LLbME9awV4xMuiFVOm6FedTlt-uEzFBnQ5hWrPpbUagtdticpeuyxVhH_T2duiev2Q" class="hidden" id="main_image_3" alt="Premium Food United Kingdom"Waleed Babar Khan" class="thumb_image_single" title="Click for next image">
</div>
<div class="item_arrow_right" style="height: 428px">
<i class="sprite_vi_arrow_right" style="margin-top: 200px"></i>
</div>
</div>
<!-- Image Thumbnails -->
<div class="item_img">
<ul class="inlined"><!--
<li><img src="http://lh5.ggpht.com/v9WiErUPsBsOtHk9cKnA_ag3glBmZ9QG1D0wGC0DrUCgAJmyasVGt6njzCK2yUX4YjVa8TTeP8h8EmuCXlEgltt0R5g=s120" alt="Premium Food United Kingdom"Waleed Babar Khan" id="thumb_image_0" class="current hoverable thumb_image"></li>-->
<li><img src="http://lh5.ggpht.com/v9WiErUPsBsOtHk9cKnA_ag3glBmZ9QG1D0wGC0DrUCgAJmyasVGt6njzCK2yUX4YjVa8TTeP8h8EmuCXlEgltt0R5g=s120" alt="Premium Food United Kingdom"Waleed Babar Khan" id="thumb_image_1" class=" hoverable thumb_image"></li>
<li><img src="http://lh4.ggpht.com/Y2IUX7VAMmxVGlf2B-3Y3TlKZ_GqgpqIX6HpyYDp3dwrI9N3Lf3QZrjGHEKhVybMxn6ke5xLVjkwBkg1frdJihxt=s120" alt="Premium Food United Kingdom"Waleed Babar Khan" id="thumb_image_2" class=" hoverable thumb_image"></li>
<li><img src="http://lh5.ggpht.com/CyuBJ4J3-CzndvoJ3q59tz29LLbME9awV4xMuiFVOm6FedTlt-uEzFBnQ5hWrPpbUagtdticpeuyxVhH_T2duiev2Q=s120" alt="Premium Food United Kingdom"Waleed Babar Khan" id="thumb_image_3" class=" hoverable thumb_image"></li>
</ul>
</div>
最佳答案
你的 item_arrow_left
和 item_arrow_right
从一些脚本中获取行内高度,这就是为什么它获得该高度图像具有正确的高度
这个脚本行可能对你有帮助
$('[class^="item_arrow_"]').css('height','auto');
关于javascript - 如何解决图像高度对于我的动态 View 而言太大的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17422601/