# Parallax

**URL:** https://forum.kirupa.com/t/parallax/634974
**Category:** web dev
**Created:** [July 24, 2016, 1:26am UTC](https://forum.kirupa.com/t/parallax/634974 "2016-07-24T01:26:54Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![VaiFanatic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vaifanatic/32/7159_2.png) [@VaiFanatic](https://forum.kirupa.com/u/VaiFanatic)
#### Post date: [July 24, 2016, 1:26am UTC](https://forum.kirupa.com/t/parallax/634974/1 "2016-07-24T01:26:55Z")

</div>

I’m creating a parallax website (using an older standard of jQuery to perform the sliding animation from the nav bar) and I’m having an issue setting the first “slide” to be max height regardless of resolution.

Here’s my HTML:

```
<!DOCTYPE html>
<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Heritage Holdings</title>
  <link rel="stylesheet" type="text/css" href="style.css" />
  <link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'>
  <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
  <script>
    $(document).ready(function() {
      $('a[href*=#]').each(function() {
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') &&
          location.hostname == this.hostname &&
          this.hash.replace(/#/, '')) {
          var $targetId = $(this.hash),
            $targetAnchor = $('[name=' + this.hash.slice(1) + ']');
          var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
          if ($target) {
            var targetOffset = $target.offset().top;
            $(this).click(function() {
              $("#nav li a").removeClass("active");
              $(this).addClass("active");
              $("html, body").animate({
                scrollTop: targetOffset
              }, 1000);
              return false;
            })
          }
        }
      });
    });
  </script>
</head>

<body>
  <!-- Begin Header -->
  <header id="header">
    <div class="content">
      <div id="logo">
        <a>Heritage Holdings</a>
      </div>
      <nav id="nav">
        <ul>
          <li><a href="#home" class="active" title="Home">Home</a></li>
          <li><a href="#properties" title="Properties">Properties</a></li>
          <li><a href="#partners" title="Partners">Partners</a></li>
          <li><a href="#contact" title="Contact">Contact</a></li>
        </ul>
      </nav>
    </div>
  </header>
  <!-- End Header -->

  <!-- Begin Slides/Pages -->

  <!-- Home Page -->
  <div id="home">
    <div class="content">
      <div id="heritage"></div>
      <div id="texas1"></div>
      <div id="texas2"></div>
      <h2>Heritage</h2>
      <h1>Holdings</h1>
    </div>
    <div>
      <!-- End Home Page -->

      <!-- Properties Page -->
      <div id="properties">
        <div class="content">
          <p>This is the properties page.</p>
        </div>
      </div>
      <!-- End Properties Page -->

      <!-- Partners Page -->
      <div id="partners">
        <div class="content">
          <p>Partners go here!</p>
        </div>
      </div>
      <!-- End Partners Page -->

      <!-- Contact Page -->
      <div id="contact">
        <div id="content">
          <p>Contact form goes here</p>
        </div>
      </div>
      <!-- End Contact Page -->
      <!-- End Slides/Page -->

</body>

</html>

```

And here is my CSS:

```
body {
	background-color:gray;
	margin:0;
	padding:0;
	width:100%;
	font-family:tahoma;
}

h1 {
	font-family:tahoma;
	font-weight:normal;
	text-align:center;
	font-size:55px;
	color:#fff;
	margin:0;
	padding:0;
}

h2 {
	font-family:tahoma;
	font-weight:normal;
	font-size:40px;
	text-align:center;
	color:#fff;
	margin:0;
	padding:0;
}

.center {
	margin:0 auto;
}
.content {
	margin:0 auto;
	width:960px;
}
.clear {
	clear:both;
}

#header {
	width:100%;
	background: url(images/header.png);
	height:80px;
	position:fixed;
	margin-top:30px;
}

#nav{
	width:410px;
	float:right;
	margin-top:20px;
}

#logo a {
	color:#fff;
	text-decoration:none;
	font-family:open sans condensed, sans-serif;
	float:left;
	font-size:30px;
	margin-top:20px;
	font-weight:bold;
}

#nav ul {
	list-style:none;
	display:block;
	margin:0 auto;
}

#nav li {
	margin-top:9px;
	float:left;
	padding-left:21px;
}

#nav li a {
	color:#fff;
	opacity:0.6;
	text-decoration:none;
}

#nav li a.active {
	color:#fff;
	opacity:1;
	border-bottom: 2px solid #fff;
}

#nav li a:hover {
	color:red;
	opacity:1;
}

#heritage {
	background:url(images/hh-logo1.gif) no-repeat height:50px width:50px;
	margin:0 auto;
	position:relative;
}

#texas1 {
	background:url(images/texas.gif) no-repeat;
	width:50px;
	height:50px;
	margin:0 auto;
	display:block;
	position:relative;
	bottom:-102px;
	left:-103px;
}
#texas2 {
	background:url(images/texas.gif) no-repeat;
	width:50px;
	height:50px;
	margin:0 auto;
	display:block;
	position:relative;
	bottom:-54px;
	right:-102px;
}
/* Pages */

#home, #properties, #partners, #contact {
	width:100%;
}

#home {
	background:url(images/lot.jpg) 50% 0 no-repeat fixed;
	color:#fff;
	min-height:100%;
	margin:0;
	padding:200px 0 260px 0;
	background-size:cover;
}

#properties {
	background-color:#fff;
	color:#333;
	height:300px;
	margin:0 auto;
	overflow:hidden;
	padding:200px 0;
}

#partners {
	background:url(images/nebula.jpg) 50% 0 no-repeat fixed;
	color:#fff;
	height:600px;
	padding:170px 0 0 0;
	background-size:cover;
}

#contact {
	background-color:#333;
	min-height:600px;
	height:100%;
	padding:200px 0;
}
```

---

<div class="post-metadata">

### Author: ![VaiFanatic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vaifanatic/32/7159_2.png) [@VaiFanatic](https://forum.kirupa.com/u/VaiFanatic)
#### Post date: [July 24, 2016, 1:27am UTC](https://forum.kirupa.com/t/parallax/634974/2 "2016-07-24T01:27:29Z")

</div>

Not sure why the CSS posted so strangely… it’s been a few years since I’ve posted here since the changes.

---

<div class="post-metadata">

### Author: ![VaiFanatic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vaifanatic/32/7159_2.png) [@VaiFanatic](https://forum.kirupa.com/u/VaiFanatic)
#### Post date: [July 24, 2016, 8:19am UTC](https://forum.kirupa.com/t/parallax/634974/3 "2016-07-24T08:19:25Z")

</div>

Disregard – I figured it out.

Thanks!

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [July 24, 2016, 4:56pm UTC](https://forum.kirupa.com/t/parallax/634974/4 "2016-07-24T16:56:30Z")

</div>

Glad you got it sorted out. The code formatting issues is something that happens every now and then. That’s something that I’ll follow-up on in the future 🙂

Also, like you mention, it **_has_** been a while since I saw your screen name participating in a HTML/CSS thread!!! Welcome back 😛

---

<div class="post-metadata">

### Author: ![VaiFanatic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vaifanatic/32/7159_2.png) [@VaiFanatic](https://forum.kirupa.com/u/VaiFanatic)
#### Post date: [July 25, 2016, 4:47am UTC](https://forum.kirupa.com/t/parallax/634974/5 "2016-07-25T04:47:37Z")

</div>

Yeah, I’m still at it!

I’m certain I’ll run into more issues as I code this, but I’m glad to be back!

😃

---

<div class="post-metadata">

### Author: ![VaiFanatic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vaifanatic/32/7159_2.png) [@VaiFanatic](https://forum.kirupa.com/u/VaiFanatic)
#### Post date: [July 26, 2016, 1:31am UTC](https://forum.kirupa.com/t/parallax/634974/6 "2016-07-26T01:31:08Z")

</div>

So, for those who were curious, my initial issue was that the closing div for the #home page was not actually a closing div, doh!!

Fixed that and also set my height and widths to 100vh and 100wh respectively for more fluidity when it comes to viewport sizes.

Now I’m having an issue with adding in an HTML5 contact form; when the page loads, it automatically loads to the contact form. Is there any way to stop this?

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [July 26, 2016, 4:23am UTC](https://forum.kirupa.com/t/parallax/634974/7 "2016-07-26T04:23:14Z")

</div>

Can you clarify what you mean by not loading the contact form when the page loads? My initial response is to just set the `display` on the form’s containing element to be **none**. Though, I’m pretty sure you would have known about that 😛

---

<div class="post-metadata">

### Author: ![VaiFanatic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vaifanatic/32/7159_2.png) [@VaiFanatic](https://forum.kirupa.com/u/VaiFanatic)
#### Post date: [July 26, 2016, 6:05am UTC](https://forum.kirupa.com/t/parallax/634974/8 "2016-07-26T06:05:28Z")

</div>

The page loads and essentially loads AT the contact form instead of loading at the top of the page.

So the form is there and it works, but when you load the page, it loads at the contact form instead of the #home slide.

---

<div class="post-metadata">

### Author: ![VaiFanatic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vaifanatic/32/7159_2.png) [@VaiFanatic](https://forum.kirupa.com/u/VaiFanatic)
#### Post date: [July 29, 2016, 5:24am UTC](https://forum.kirupa.com/t/parallax/634974/9 "2016-07-29T05:24:19Z")

</div>

Still haven’t managed to solve this! It’s bugging me.

I’ve looked at other parallax pages with contact forms, and can’t seem to be able to dissect their code to see what they do to keep their page from loading to the form straight away.
