Skip to content

Instantly share code, notes, and snippets.

@Bijesse
Created March 17, 2015 18:24
Show Gist options
  • Save Bijesse/9948af873931a90db0e6 to your computer and use it in GitHub Desktop.
Save Bijesse/9948af873931a90db0e6 to your computer and use it in GitHub Desktop.
Help Box jQuery // source http://jsbin.com/hipoto
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>Help Box jQuery</title>
<style id="jsbin-css">
#help {
position: absolute;
background: red;
width: 200px;
height: 150px;
top: 50%;
left: 50%;
margin-left: -100px;
margin-top: -75px;
}
#outer-help {
position: fixed;
left:0;
right:0;
top:0;
bottom:0;
}
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="outer-help"><div id="help">MY PROJECT IS AWESOME</div></div>
<script id="jsbin-javascript">
$(function() {
$('#outer-help').hide();
$(document.body).keypress(function(e) {
if(e.keyCode === 63) {
$('#outer-help').show();
$('#outer-help').click(hideHelp);
}
});
});
function hideHelp() {
$('#outer-help').hide();
}
</script>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"><\/script>
<meta charset="utf-8">
<title>Help Box jQuery</title>
</head>
<body>
<div id="outer-help"><div id="help">MY PROJECT IS AWESOME</div></div>
</body>
</html></script>
<script id="jsbin-source-css" type="text/css">#help {
position: absolute;
background: red;
width: 200px;
height: 150px;
top: 50%;
left: 50%;
margin-left: -100px;
margin-top: -75px;
}
#outer-help {
position: fixed;
left:0;
right:0;
top:0;
bottom:0;
}
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}</script>
<script id="jsbin-source-javascript" type="text/javascript">$(function() {
$('#outer-help').hide();
$(document.body).keypress(function(e) {
if(e.keyCode === 63) {
$('#outer-help').show();
$('#outer-help').click(hideHelp);
}
});
});
function hideHelp() {
$('#outer-help').hide();
}</script></body>
</html>
#help {
position: absolute;
background: red;
width: 200px;
height: 150px;
top: 50%;
left: 50%;
margin-left: -100px;
margin-top: -75px;
}
#outer-help {
position: fixed;
left:0;
right:0;
top:0;
bottom:0;
}
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
$(function() {
$('#outer-help').hide();
$(document.body).keypress(function(e) {
if(e.keyCode === 63) {
$('#outer-help').show();
$('#outer-help').click(hideHelp);
}
});
});
function hideHelp() {
$('#outer-help').hide();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment