<script src="https://raw.github.com/LeaVerou/prefixfree/gh-pages/prefixfree.min.js"></script>
<html>
<body class='loading'>
<section id='loading'>
<div>
<h2>Simple 1-page navigation with CSS3 and :target</h2>
This panel will show while loading your resources.
It will disappear when the body class is removed.
</div>
</section>
<section id='start'>
<a href="#start">Start</a>
<div>
<h2>Simple 1-page navigation with CSS3 and :target</h2>
<p>This is the startpage. </p>
<p>window.location.hash is now '#start', making section id='start' the :target div.</p>
</div>
</section>
<section id='step2'>
<a href="#step2">Step2</a>
<div>
This is the 2nd page<br> <a href='#step4'>Jump to page 4</a>
</div>
</section>
<section id='step3'>
<a href="#step3">Step3</a>
<div>
This is the 3rd page
</div>
</section>
<section id='step4'>
<a href="#step4">Step4</a>
<div>
This is the 4th page
(It's overflowing, scroll down)
<p style='margin-top: 1000px'>It even scrolls on webkit without iScroll!</p>
</div>
</section>
<section id='step5'>
<a href="#step5">Step5</a>
<div>
This is the 5th page
</div>
</section>
<section id='step6'>
<a href="#step6">Step6</a>
<div>
This is the 6th page
</div>
</section>
</body>
</html>
/* You can also do this on domready or onload ofcourse */
setTimeout(function() {
document.body.className = '';
window.location.hash = 'start';
}, 1500);
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.