简体   繁体   English

用于在按钮单击时更改div高度的Javascript?

[英]Javascript for changing div height on button click?

So what my code looks like.. Now the problem is that Everything is fine when the result div opens, but when this page is accessed the main wrapper takes the height of the left nav.. I wanna know if there is a way i can modify the div height when the result div is called.. Is there a javascript to which an ajax call can be given?? 所以我的代码看起来像..现在的问题是,当打开结果div时,一切都很好,但是当访问此页面时,主包装器占据了左侧导航栏的高度。.我想知道是否有办法调用结果div时,修改div的高度。是否可以给ajax调用一个javascript? Really appreciate the help.. Thanks! 非常感谢您的帮助。。谢谢!

<div id="main-container">

    <!--header starts-->
    <jsp:include page="../common/header.jsp" />
    <!--header ends-->

    <!--body content starts-->
    <div id="main-content-wrapper">

        <!--body content left starts-->
        <jsp:include page="../common/leftNavigation.jsp" />
        <!--body content left ends-->

        <!--body content right starts-->

        <form:form name="submitForm" action="storemonthly" method="POST"
            commandName="storePerformanceVO">

            <div id="printDiv">
                <div id="maincontent-right-wrapper">
                    <div class="page-heading-dailyroaster">
                        <spring:message
                            code="rmp.store_performance_monthly.page_header.store_performance_monthly" />
                    </div>
            <!--shop starts-->
                    <div class="store-setup-wrapper">

                        <!--shop starts-->
                        <div class="shop-promoter-wrapper">
                            <div class="shop-promoter-inner">

                                <ul>

                                    <li><spring:message
                                            code="rmp.store_performance_monthly.label.store" />:</li>
                                    <li>&nbsp;</li>
                                    <li><form:select path="storeid" style="width:200px;">
                                            <form:options items="${StoreList}" itemValue="storeId"
                                                itemLabel="storeName" />
                                        </form:select></li>
                                    <li><img src="../static/images/spacer.gif" width="26"
                                        height="1" /></li>
                                </ul>

                            </div>

                        </div>
                        <!--shop ends-->



                    </div>
                    <!--shop ends-->

                    <!--daily-roaster-wrapper starts-->
                    <div id="resultDiv"></div>
                    <!--page bottom ends-->

                </div>

            </div>
        </form:form>
        <!--body content right ends-->


    </div>
    <!--body content ends-->
    <!--footer starts-->
    <div class="footer">&nbsp;</div>
    <!--footer ends-->
</div>

给出结果的高度div

document.getElementById(DivID).style.height=50

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM