Skip to content

Instantly share code, notes, and snippets.

Created April 29, 2016 15:06
Show Gist options
  • Save anonymous/48cf8bdc4a73bd8cf545347989feb900 to your computer and use it in GitHub Desktop.
Save anonymous/48cf8bdc4a73bd8cf545347989feb900 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
$(document).ready(function () {
$("#showHideBasicFunctions").click(function () {
$("#basicFunctions").hide();
});
$("p").click(function () {
$(this).hide();
});
$("#h3element").click(function () {
$(this).hide();
});
$(".someClass").click(function () {
$(this).hide();
});
$("#doubleClickMe").dblclick(function () {
$(this).hide();
});
$("#mouseEnterLeaveOnMe").mouseenter(function () {
$(this).hide();
});
$("#mouseEnterLeaveOnMe").mouseleave(function () {
$(this).show();
});
$("#hoverOnMe").hover(function () {
alert("You entered me! :O");
},
function () {
alert("And now you left me! :(");
});
});
</script>
<h2>Test1</h2>
<div>
<span><button id="showHideBasicFunctions">Show/Hide Basic Functions</button></span>
</div>
<div id="#basicFunctions">
<h3>Click these paragraphs to hide them!!</h3>
<p>Hello World!</p>
<p>Hello World again!!!</p>
<p>Hello World!</p>
<p>Hello World!</p>
<h3 id="h3element">I am selected by ID!</h3>
<h3 class="someClass">And I am selected by Class!</h3>
<h3 id="doubleClickMe">You need to double-click me!</h3>
<h3 id="mouseEnterLeaveOnMe">You need to hover on me with the mouse to hide me!</h3>
<h3 id="hoverOnMe">Hover on me to show some messages!</h3>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment