简体   繁体   English

如何使页脚弹出窗口覆盖所有页面?

[英]How to make a footer popup to cover all page?

I want to do the following:我想做以下事情:

  1. Press menu link called "Contacts" - Done按名为“联系人”的菜单链接 -完成
  2. Create a footer with Email, Rights & Contacts - Done创建带有电子邮件、权限和联系人的页脚 -完成
  3. After press "Contacts" (menu), all page becomes white and Email, Rights & Contacts stay on middle (jQuery maybe?)按“联系人”(菜单)后,所有页面都变成白色,电子邮件、权限和联系人保持在中间(也许是 jQuery?)

Is this possible?这可能吗?

I don't want to create a page with contact forms, just for this.我不想创建带有联系表单的页面,仅此而已。 I should just continue my index.html page with #contacts on bottom, and use Parallax or FullPage.JS?我应该继续我的 index.html 页面底部的 #contacts,并使用 Parallax 或 FullPage.JS?

See the page & code: www.wemadeyou.pt查看页面和代码: www.wemadeyou.pt

Yes this is possible and not very difficult.是的,这是可能的,而且不是很困难。 One way you can do it make a div on the page and use css display: none to hide the div .一种方法是在页面上创建一个div并使用 css display: none来隐藏div Then use jQuery to show that div when the 'Contacts' menu button is clicked.然后在单击“联系人”菜单按钮时使用 jQuery 显示该div

Something like:就像是:

Html:网址:

<body>
  <p>Here is some content</p>

  <div class="contact-form-container">
    <form class="contact-form">
    <!-- put your contact form here -->
    </form>
  </div>

</body>

CSS: CSS:

.contact-form-container {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.25);
  z-index: 200;
}

JS (jquery): JS(jQuery):

$(document).ready(function() {
  $('.contacts').click(function(e) {  //or whatever the class/id of your menu button is
    e.preventDefault();
    $('.contact-form-container').toggle();
  }
}

This will get you most of the way there.这将使您获得大部分途径。 You will still have to handle the form of course.当然,您仍然必须处理表单。

Hope that helps.希望有帮助。

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

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