I'm in the process of learning JQuery using CodeAcademy. Well when jquery creates an effect on a HTML element, say specifically fadeOut, does it remove the HTML element from the page? Or does it push it into some data structure of sort?
The reason for the question is that, I noticed ( in the below code of mine), that once a button is faded out, the adjacent button takes it place. Since I FADE IN later, the element has to be present somewhere. So how does JQUERY work exactly?
I'm new to even HTML so please be kind.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Vanishing Act</title>
<link rel='stylesheet' type='text/css' href='stylesheet.css'/>
<script type='text/javascript' src='script.js'></script>
</head>
<body>
<div id="blue"></div>
<div></div>
<div></div>
<div></div>
<br/><button>Click Me!</button>
</body>
</html>
CSS
div {
height: 100px;
width: 100px;
display: inline-block;
background-color: #F38630;
border-radius: 5px; }
#blue {
background-color: #A7DBD8; }
Script
$(document).ready(function() {
$('button').click(function() {
$('#blue').fadeOut('slow');
$('button').click(function(){
$('#blue').fadeIn('slow');
});
});
});