HTML and CSS Reference
In-Depth Information
Here is the first function:
function formOut() {
if(form.className===”” || form.className===”form-in”) {
if(Modernizr.cssanimations) {
;
} else {
;
t = ;
}
h1.innerHTML = “Hide feedback form!”;
} else {
if(Modernizr.cssanimations) {
;
} else {
;
t = ;
}
h1.innerHTML = “Give us your feedback!”;
}
}
I've used an
if ... else
statement to see whether the form is offscreen and I
want to move it on or whether it is onscreen and I want to move it off.
form.className===”” || form.className===”form-in”
basically specifies “if
the form's class is empty OR it is set to
form-in
, then it will be offscreen; therefore,
run the first Modernizr test.”
modernizr.cssanimations
tests whether CSS Anima-
tions are supported by the current browser. If they are, then set the form's class
value to
form-out
to trigger the animation that brings it onscreen.