简体   繁体   English

一次滑动多个元素

[英]SlideDown multiple elements at once

I have a div for a form 我有一个表格的div

<div class="form" style="display:none">

inside this div, I have several divs 在这个div内,我有几个div

Example

<div class="row">
    <?php echo $form->labelEx($model,'comment'); ?>
    <?php echo $form->textField($model,'comment',array('size'=>60,'maxlength'=>140)); ?>
    <?php echo $form->error($model,'comment'); ?>
</div>

I'd like to slidedown all the div smoothly . 我想顺利滑下所有的div。

I simply tried 我只是尝试

$(".form").slideDown(2000);  

it slidedown div by div which give a very ugly effect. div div向下滑动,效果非常难看。 How to slidedown as it was a single div ? 由于它是单个div,如何下滑?

the complete form is the following 完整的表格如下

<p>
    <div class="form" style="">
        <form id="comment-form" method="post" action="/post/index.php/comment/create>
            <p class="note">
            Fields with
                <span class="required">*</span>
                are required.
            </p>
            <div id="comment-form_es_" class="errorSummary" style="display:none">
                <p>Please fix the following input errors:</p>
                <ul>
            </div>
            <div class="row">
                <label class="required" for="comment_comment">
                Comment
                <span class="required">*</span>
                </label>
                <input id="comment_comment" type="text" name="comment[comment]" maxlength="140" size="60">
                <div id="comment_comment_em_" class="errorMessage" style="display:none"></div>
            </div>
            <div class="row">
                <label class="required" for="comment_type_id">
                    Type
                    <span class="required">*</span>
                </label>
                <input id="comment_type_id" type="text" name="comment[type_id]">
                <div id="comment_type_id_em_" class="errorMessage" style="display:none"></div>
            </div>
            <div class="row buttons">
                <p>
                <input type="submit" value="Create" name="yt0">
            </div>
        </form>
    </div>
</p>
</div>

Thank you for your help 谢谢您的帮助

Wrap them all with a single DIV, then slide that parent DIV down. 用一个DIV将它们全部包裹起来,然后向下滑动该父DIV。

If you are already doing that, then it is likely that there are other divs with class="form" on them - probably being generated by the tags. 如果您已经这样做了,那么很可能还有其他带有class =“ form”的div-可能是由标签生成的。 Change the parent div to a unique class name or ID and slideDown that instead. 将父div更改为唯一的类名或ID,然后将其向下滑动。

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

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