Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
<head>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.6/prefixfree.min.js"></script>-->
<script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
  
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
<div class="cover slide" onClick="goToByScroll('p1')">
  <table><td><div>
  <h1>Story Time</h1>
    <span >Click Anywhere to Continue</span>
    </div></td></table>
</div>
  
<div class="p1 slide" onClick="goToByScroll('p2')">
<table><td><div>
   
  <img class="floating" src="http://www.eznetu.com/castle.png" />
  <p>Once Upon a Time there was a Castle in the Clouds.</p>
    
</div></td></table>
</div>
  
  <div class="p2 slide" onClick="goToByScroll('p3')">
    <table><td><div>
    
  <p>Inside lived a kindly giant</p>
    
    </div></td></table>
</div>
  
  
<div class="p3 slide" onClick="goToByScroll('p4')"><table><tr><td><div>
    
  <p>He was a nice guy, I'm serious!</p>
    
  </div></td></tr></table>
</div>
  
  <div class="p4 slide" onClick="goToByScroll('p5')"><table><tr><td><div>
    
  <p>Every day he would go to the park and feed the birds.  He would even give money the homeless giants. </p>
    
  </div></td></tr></table>
</div>
  
    <div class="p5 slide" onClick="goToByScroll('p6')"><table><tr><td><div>
    
  <p>One night a mean little kid named Jack came and stole all his treasure.</p>
    
  </div></td></tr></table>
</div>
  
    <div class="p6 slide" onClick="goToByScroll('p7')"><table><tr><td><div>
    
  <p>The giant was angry.</p>
    
  </div></td></tr></table>
</div>
  
 <div class="p7 slide" onClick="goToByScroll('p8')"><table><tr><td><div>
    
  <p>So he chased him down the beanstalk.</p>
    
  </div></td></tr></table>
</div>
  
   <div class="p8 slide" onClick="goToByScroll('p9')"><table><tr><td><div>
    
  <p>But that didn't work out so well...</p>
    
  </div></td></tr></table>
</div>
  
  
     <div class="p9 slide" onClick="goToByScroll('p10')"><table><tr><td><div>
    
  <p>The End</p>
    
  </div></td></tr></table>
</div>
  
  
       <div class="p10 slide" ><table><tr><td><div>
    
  <p>This short story is a test to see how well I can make a responsive (intereactive) book that can be viewed online.</p>
         <!--<div class="button" onClick="goToByScroll('cover')">Back to Top &and; </div>-->
         
         <p>See also... <a target="_blank" href="https://codepen.io/stevenmonson/pen/NqOqWR">A Very Dangerous Dragon</a></p>
    
  </div></td></tr></table>
</div>
</body>
</html>

              
            
!

CSS

              
                html, body {
  height:100%;
}
body {
  font-size:100%;
  margin:0;
  background:black;
  font-family:georgia;
  text-align:center;
}
.slide{
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;  
  border:solid 1em #000;
  background:#fff;
  cursor: pointer;
  height:100vh;
}

.slide table {
width:90%;
height:90%;
  margin:auto 5%;
  overflow:auto;
}

.slide td {
  hieght:100%;
   vertical-align:middle;
}
.slide div {
 max-width:37.5vw;
 margin:auto;
}

img {max-width:100%; height:auto;
border:none; //max-height:25%;}

h1 {
font-weight:normal;
font-size:3.8em;
font-size:5vw;
text-align:center;
}
p { font-size:1.7em; font-size:2.25vw; line-height:1.4; margin:.2em auto;}

.cover{background: #f2eee2;}

.p1{background: #eef0fd;}
.p2{background: url(http://www.eznetu.com/happy-giant.png) no-repeat bottom #9cddee; 
  background-size:auto 50%; 
}	
.p3{background:  #f3c36f;
}
.p4{background: #def;}
.p5{background: #123; color:#ccc;}
.p6 {background:#800; color:#ffe;}
.p7 { background:url(http://www.eznetu.com/beanstalk-rough.png) right bottom no-repeat #59c;
  background-size:auto 100%; 
color:#cfa;
}
.p8 {background:#222; color:#bbb;}
.p9 {background:#ccc; color:#333;}
.p10 {cursor:default;}

.button {
  display:inline-block;
  background:black;
  color:white;
  padding:.75em;
  border-radius:6px;
  cursor:pointer;
  transition: .25s ease-out;
}
.button:hover {
  background:#c11; 
}


.floating {
  border:solid transparent;
animation: floating 5s ease-in-out infinite;
}

@keyframes floating {
  50% {transform: translateY(9px);}
}


@media screen and (max-width:600px) {
  body{
  font-size:85%;
  }
  p {  font-size:3.5vw; }
}
              
            
!

JS

              
                /*$(function() {
 $('.slide').css({
   'height': (($(window).height()) -40)
  });
});*/

/*$(function(){
  setHeight(); 
});

$(window).resize(function() {
  setHeight(); 
});

function setHeight() {
  var Height = $(window).height();
  $('.slide').css('height', Height);
  
}
*/

  
function goToByScroll(id){			$('html,body').animate({
  scrollTop: $("."+id).offset().top +0
  },400);
}
              
            
!
999px

Console