I have a hidden div element called "contactbox". The DIV contains a message form and some links. I would like "contactbox" to be shown once the link called "contact" is clicked, but my JQuery doesn't want to cooperate:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(document).ready(
function(){
$("#contact").click(function (e) {
e.preventDefault();
$("#contactbox").show("slow");
});
});
</script>
The "contactbox" element also contains a child element called "Leave" in the top left corner, that will hide it if clicked afterwards, kind of like closing a window that you just opened on your computer. I figured that the JQuery for this would be the following, am I correct?
<script>
$(document).ready(
function(){
$("#Leave").click(function (e) {
e.preventDefault();
$("#contactbox").hide("slow");
});
});
</script>