繁体   English   中英

jQuery SlideToggle向下滑动,然后后退以覆盖内容

[英]JQuery SlideToggle Sliding Down, then back up to cover content

修复! 我将dt和dd设置为float:向左移动,所以当切换执行时,标头试图将其放置在内容旁边并覆盖它? 不确定,但是将浮子从固定位置移开。 现在,如果有人可以解释为什么...

我不确定如何说明问题,但我有...

 <section id="contact-page">
<div class="contact-wrapper">
    <h1>Contact Us</h1>
    <dl class="contact">
        <dt>Contact</dt>
        <dd>Email: <a href="mailto:myemail@gmail.com">myemail@gmail.com</a></dd>
        <dd>Phone: (812 000 0000)</dd>
    </dl>
    <dl class="address">
        <dt>Address</dt>
        <dd>I forgot to take out my addrss</dd>
        <dd>CHere too...</dd>
        <dd>United States</dd>
    </dl>
    <dl class="business-hours">
        <dt>Business Hours</dt>
        <dd>Monday &mdash; Friday</dd>
        <dd>10am to 6pm</dd>
    </dl>
</div>

非常相关的Javascript

<script>
$(document).ready(function(e){

   $('#contactclick').on('click',function(){

      $('#contact-page').slideToggle();

   });

})
</script>

发生了向下滑动,但是一旦滑到底部,就会向上滑动,因此仅显示h1标题“联系我们”。 可能是利润问题吗? js的新手,所以这困扰了我。

相关的CSS

    .contact-page {
    overflow: hidden;
}

#contact-page {
    clear: both;
    color: #FFF;
    display: none;
    font-family: 'Fenix', serif;
    font-size: 1.8rem;
    letter-spacing: .12rem;
    padding-bottom: 1.5rem;
    padding-top: 6rem;
    text-align: center;
    width: 100%;
}
#contact-page dl {
    float: left;
    margin-top: 2rem;
    text-align: center;
    width: 20%;
}
#contact-page dl dd {
    line-height: 1.7rem;
    margin: 0;
}
#contact-wrapper {
    background: rgba(0 0 0 .1);
    display: ;
    margin: 0 auto;
    position: relative;
    width: 100%;
}

dl {
    float: left;
    margin-top: 2rem;
    text-align: center;
    width: 20%;
}

dd {
    margin: 0 0 0 40px;
}

现在有了之前和之后的图像! http://imgur.com/2VfXaLw,aryV2VD#0

修复! 我将dt和dd设置为float:向左移动,所以当切换执行时,标头试图将其放置在内容旁边并覆盖它?

暂无
暂无

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

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