<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
body {
color: #555;
background: #eee;
}
h1 {
font-family: sans-serif;
font-size: 2em;
margin: 20px 0 0 0;
text-align: center;
}
h2 {
font-family: sans-serif;
font-size: 1.2em;
text-align: center;
}
p {
padding: 10px 0 0;
color: #222;
font-family: sans-serif;
font-weight: bold;
text-align: center;
}
.wrap {
position: relative;
height: 100%;
}
.clip {
position: absolute;
transition: all 1s ease;
z-index: 1;
}
.c1 {
top: 100px;
left: 0;
clip: rect(140px, 300px, 200px, 250px);
}
.c2 {
top: 250px;
left: 300px;
clip: rect(80px, 210px, 160px, 100px);
}
.c3 {
top: 60px;
left: 300px;
clip: rect(110px, 160px, 170px, 60px);
}
.c4 {
top: 100px;
left: 600px;
clip: rect(160px, 130px, 220px, 60px);
}
.c5 {
top: 400px;
left: 0px;
clip: rect(60px, 250px, 130px, 180px);
}
.c6 {
top: 400px;
left: 400px;
clip: rect(80px, 160px, 160px, 70px);
}
.clip:hover {
clip: rect(0, 400px, 260px, 0);
cursor: pointer;
z-index: 999;
}
</style>
</head>
<body>
<h1>Hover Over The Images</h1>
<h2>Demo gallery using CSS <code>clip</code> to show/hide images</h2>
<div class="wrap">
<figure class="clip c1">
<img src="http://cdn.impressivewebs.com/2011-11/greece001.jpg" alt="" width="400" height="260">
</figure>
<figure class="clip c2">
<img src="http://cdn.impressivewebs.com/2011-11/greece002.jpg" alt="" width="400" height="260">
</figure>
<figure class="clip c3">
<img src="http://cdn.impressivewebs.com/2011-11/greece003.jpg" alt="" width="400" height="260">
</figure>
<figure class="clip c4">
<img src="http://cdn.impressivewebs.com/2011-11/greece004.jpg" alt="" width="400" height="260">
</figure>
<figure class="clip c5">
<img src="http://cdn.impressivewebs.com/2011-11/greece005.jpg" alt="" width="400" height="260">
</figure>
<figure class="clip c6">
<img src="http://cdn.impressivewebs.com/2011-11/greece006.jpg" alt="" width="400" height="260">
</figure>
</div>
</body>
</html>
if (document.getElementById('hello')) {
document.getElementById('hello').innerHTML = 'Hello World - this was inserted using JavaScript';
}
Output
300px
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |