I've found a lot of documentation on animations regarding jQuery, but yet can't find something I can work with.
What I am trying to do is the following:
1.The Eagle and the form go up at the same time and with the same speed (which works well now). This only happens AFTER someone has filled in the form and clicks on Send.
This animation is working fine but not after someone has filled in the form and clicks on send. I believe I need to add a preventDefault();
, don't know where to put it exactly though.
2. When they are animated up, a filter effect get's applied, which changes the color of the eagle, top curtains and the background image. This filter effect is set in CSS. I am trying to keep my css code inside my css and my jQuery apart from it as much as possible.
3. Then the Eagle and the form come down gain to their original position.
I believe I have to use queues for something like this and have no idea how to use them. So maybe someone could also provide me some info about queues as well.
Looking forward to suggestions.
See live website here: http://demo.chilipress.com/epic3/
See the image for how the page looks like AFTER the form is submitted:
HTML
<img class="bg_green bg_blue" src="assets/contact_background.jpg">
<div class="curtain_green curtain_blue "></div>
<div class="eagle_green eagle_blue"></div>
<div id="content">
<div class="contact">
<form>
<fieldset class="name">
<label for="name" class="name group">Name</label>
<input type="name" id="name" name="name" required pattern="[A-Za-z-0-9]+\s[A-Za-z]+" title="firstname lastname"/>
</fieldset>
<fieldset class="send">
<input type="submit" value="Send" class="sendButton">
</fieldset>
</form>
</div>
</div>
CSS
img.bg_blue{
display: none;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' ><filter id=\'huerotate\'><feColorMatrix type=\'hueRotate\' values=\'46\' /></filter></svg>#huerotate");
-webkit-filter: hue-rotate(46deg); /* Chrome 19+, Safari 6+, Safari 6+ iOS */}
img.bg_green {
/* Set rules to fill background */
height: 100%;
min-width: 240px;
/* Set up proportionate scaling */
width: 100%;
/* Set up positioning */
position: fixed;
top: 0;
left: 0;
display: block;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' ><filter id=\'huerotate\'><feColorMatrix type=\'hueRotate\' values=\'0\' /></filter></svg>#huerotate");
-webkit-filter: hue-rotate(0deg); /* Chrome 19+, Safari 6+, Safari 6+ iOS */}
.curtain_blue{
display: none;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' ><filter id=\'huerotate\'><feColorMatrix type=\'hueRotate\' values=\'46\' /></filter></svg>#huerotate");
-webkit-filter: hue-rotate(46deg); /* Chrome 19+, Safari 6+, Safari 6+ iOS */}
.curtain_green{
background-image: url('spriteContact.png');
width: 35.1%;
height: 0;
padding-bottom: 7%;
background-position: 0 0;
background-size: 100%;
display: block;
top: 0;
position: absolute;
margin: 0 0 0 32.1%;
z-index: 2;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' ><filter id=\'huerotate\'><feColorMatrix type=\'hueRotate\' values=\'0\' /></filter></svg>#huerotate");
-webkit-filter: hue-rotate(0deg); /* Chrome 19+, Safari 6+, Safari 6+ iOS */}
.eagle_blue{
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' ><filter id=\'huerotate\'><feColorMatrix type=\'hueRotate\' values=\'46\' /></filter></svg>#huerotate");
-webkit-filter: hue-rotate(46deg); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
display: none;}
.eagle_green{
background-image: url('spriteContact.png');
width: 27.5%;
height: 0;
padding-bottom: 31.6%;
background-position: 0 27%;
background-size: 100%;
display: block;
top: 0;
position: absolute;
margin: -2% 0 0 35.8%;
z-index: 1;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' ><filter id=\'huerotate\'><feColorMatrix type=\'hueRotate\' values=\'0\' /></filter></svg>#huerotate");
-webkit-filter: hue-rotate(0deg); /* Chrome 19+, Safari 6+, Safari 6+ iOS */}
jQuery
$(document).ready(function(){
$('input[value="Send"').on("click", function(e) {
$(".eagle_green").animate({"top": "-130px"}, 2200);
$("#content").animate({"top": "-120px"}, 2200);
});
});