<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<div id="top" class="group">
<header id="header">
<h2>
header
</h2>
</header>
<menu>
<div class="arrow"></div>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#map">Map</a></li>
</ul>
</menu>
</div>
<div id="main">
<span id="home">
<p>home page</p>
</span>
<span id="map">
<div id="map_canvas"></div>
</span>
</div>
/* CSS FOR THE MAP */
html, body{
height: 100%;
margin: 0px;
padding: 0px
}
#map_canvas {
margin-top:3px;
height:300px;
}
/* Important rule for the functioning of the switcher */
#main > span{display:none}
/* Whole CSS */
body { background: #7A8498; }
div#main { font-size: 16px; line-height: 26px; color: #fff; }
div#main div.fancy-select { margin: 0 auto 60px; width: 200px; }
div#main p { margin-bottom: 24px; }
div#main a { text-decoration: none; color: #BAC9E7; font-weight: 600; }
div#main span { width: 940px; margin: 90px auto; }
div#main section h2, div#main section h3 { font-size: 22px; margin-bottom: 18px; font-weight: 600; }
*{margin:0;padding:0;border:0;box-sizing:border-box;box-sizing:border-box;box-sizing:border-box;box-sizing:border-box;box-sizing:border-box}
html{overflow-y:scroll}
body,input,select,textarea,button{font-smoothing:antialiased;text-rendering:optimizeLegibility;font-family:"Open Sans", sans-serif}
a{tap-highlight-color:#87BEC3}::selection{background:#87BEC3;color:#fff;text-shadow:none}
::selection{background:#87BEC3;color:#fff;text-shadow:none}
img{interpolation-mode:bicubic}
strong{font-weight:bold}
em{font-style:italic}
.group:after{content:".";display:block;height:0;clear:both;visibility:hidden}
* html .group{height:1%}
*:first-child+html .group{min-height:1px}
div#top{background:#22262A}
div#top #header{width:940px;margin:0 auto 52px;padding-top:30px}
div#top menu{background:#363B40;padding:19px 0;position:relative}
div#top menu div.arrow{content:"";display:block;width:0;height:0;border:7px solid transparent;border-top-color:#363B40;position:absolute;bottom:-14px;left:50%;margin-left:-7px;transition:left 300ms ease-out;transition:left 300ms ease-out;transition:left 300ms ease-out;transition:left 300ms ease-out;transition:left 300ms ease-out}
div#top menu ul{list-style:none;text-align:center}
div#top menu ul li{display:inline-block;margin:0 42px}
div#top menu ul li a{color:#5D6268;text-transform:uppercase;font-weight:bold;padding:3px 6px;text-decoration:none;transition:color 300ms ease-out;transition:color 300ms ease-out;transition:color 300ms ease-out;transition:color 300ms ease-out;transition:color 300ms ease-out}
div#top menu ul li a.current{color:#fff}
/* JS FOR THE SWITCHER */
$(document).ready(function() {
var menu = $('#top').find('menu');
function positionMenuArrow() {
var current = menu.find('.current');
menu.find('.arrow').css('left', current.offset().left + (current.outerWidth() / 2));
}
$(window).on('resize', positionMenuArrow);
menu.on('click', 'a', function(e) {
var el = $(this),
href = el.attr('href'),
currentSection = $('#main').find('.current');
e.preventDefault();
menu.find('.current').removeClass('current');
el.addClass('current');
positionMenuArrow();
if (currentSection.length) {
currentSection.fadeOut(300).promise().done(function() {
$(href).addClass('current').fadeIn(300);
});
} else {
$(href).addClass('current').fadeIn(300);
}
});
menu.find('a:first').trigger('click')
});
/* JS FOR THE MAP */
var map;
var center = new google.maps.LatLng(-25.363882,131.044922);
function initialize() {
// Map options
var mapOptions = {
zoom: 4,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
// Attach the map to the document
map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
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. |