【问题标题】:How to solve that image height gets too large for my dynamic views?如何解决图像高度对于我的动态视图来说太大的问题?
【发布时间】:2013-07-02 09:57:46
【问题描述】:

背景: Why does image height get so large in this example? 即使我从问题中应用了修复程序,问题仍然出现:

您认为问题出在表示层还是服务器端?我想我可以解决这个问题,但是有很多组件,并且可能有一个超级简单的解决方案,它似乎只是将图像高度设置为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>

该示例的实时视图是here,而它最常见的工作示例是here

【问题讨论】:

    标签: javascript html css google-app-engine python-2.x


    【解决方案1】:

    您的 item_arrow_leftitem_arrow_right 从某些脚本中获取内联高度,这说明为什么它会获得图像具有正确高度的高度

    此脚本行可能会对您有所帮助

    $('[class^="item_arrow_"]').css('height','auto');
    

    【讨论】:

    • 成功了!但不是这个脚本,当我将 HTML 更改为 &lt;div class="item_arrow_right" style="height:auto"&gt; 时它工作了@谢谢!
    猜你喜欢
    • 2012-10-21
    • 2011-07-09
    • 1970-01-01
    • 2015-01-10
    • 1970-01-01
    • 1970-01-01
    • 2021-12-04
    • 2020-10-31
    • 2012-06-16
    相关资源
    最近更新 更多