Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>HTML</strong> </p> <pre><code>&lt;div id="wrapper"&gt; &lt;div class="header"&gt; &lt;div class="header-wrapper"&gt; &lt;img src="logo.jpg" class="logo"/&gt; &lt;a href="#" onClick="scrollContent('about')" class="about"&gt;About&lt;/a&gt; &lt;a href="#" onClick="scrollContent('contact')" class="contact"&gt;Contact&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="part1"&gt; &lt;div class="part1-wrapper"&gt; &lt;!-- some content --&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="part2 about" id="about"&gt; &lt;div class="part2-wrapper"&gt; &lt;!-- About us --&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="part3 contactus" id="contact"&gt; &lt;div class="part3-wrapper"&gt; &lt;!-- Contact us --&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>#wrapper { padding-top: 35px; } .header { background: #666; position: fixed; top: 0; left: 0; width: 100%; height: 35px; z-index: 9999; } .header a { float: left; margin: 8px 18px 0 0; font-family: Verdana; font-size: 14px; text-decoration: none; letter-spacing: 1px; color: #fff; transition: color 0.2s ease-in; } .header a:hover { color: #ddd; } .logo { float: left; margin-right: 30px; } .part1, .part2, .part3 { position: relative; width: 100%; } .part1 { background: #aaa; } .part2 { background: #ccc; } .part3 { background: #eee; } .part1-wrapper, .part2-wrapper, .part3-wrapper { width: 960px; margin: 0 auto; padding: 10px; } </code></pre> <p><strong>jQuery</strong></p> <pre><code>function scrollContent(id) { $( 'html, body' ).stop().animate({ scrollTop: $( '#' + id ).offset().top }, 1200 ); } $(function () { var parts = $('.part1, .part2, .part3'); parts .css({ height: $(window).innerHeight(), width: $(window).innerWidth() }); }); </code></pre> <p>jsFiddle - <a href="http://jsfiddle.net/mdesdev/VJxeH/" rel="nofollow">http://jsfiddle.net/mdesdev/VJxeH/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload