我想做以下事情:
这可能吗?
我不想创建一个包含联系表单的页面,仅此而已。我应该在底部使用#contacts继续我的index.html页面,并使用Parallax或FullPage.JS?
查看页面&代码: www.wemadeyou.pt
答案 0 :(得分:1)
是的,这是可能的,并不是很困难。一种方法是在页面上创建div
并使用css display: none
隐藏div
。然后使用jQuery在' Contacts'时显示div
。单击菜单按钮。
类似的东西:
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:
.contact-form-container {
display: none;
position: absolute;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.25);
z-index: 200;
}
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();
}
}
这将帮助你完成大部分工作。你仍然需要处理当然的形式。
希望有所帮助。