<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div class="text">
Click the button below to show a gray screen and make a white modal come down from the top. You'll need to:
<ul>
<li>Add 2 CSS rulesets</li>
<li>Fill in the jQuery</li>
<li>Do one more thing</li>
</ul>
For extra credit, make the modal close button work.
<br><br>
<button class="show-it">Show me a modal!</button>
<br><br><a href="http://jsbin.com/OPiBagE/1/edit" target="_blank">Answer</a>
</div>
<div class="screen">
</div>
<div class="modal">
It doesn't matter what comes, fresh goes better in life, with Mentos fresh and full of Life!
<br>
<button class="close-it">Close</button>
</div>
</body>
</html>
html, body {
height: 100%;
background: fuchsia;
font-family: Helvetica;
}
.text {
padding: 0 10%;
max-width: 600px;
color: white;
font-size: 20px;
margin: 0 auto;
}
button {
font-size: 15px;
}
.screen {
display: none;
}
.modal {
top: -200px;
position: absolute;
z-index: 1000;
left: 50%;
margin-left: -100px;
color: purple;
background: white;
width: 200px;
border-radius: 10px;
padding: 10px;
}
div.screen {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 100;
background: rgba(0,0,0,.8);
}
Output
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. |