use jQuery effects and animation
For this lab, we will modify our index file (from lab 5) to include a newsletter signup form. The form will be hidden when the page loads, but will display when the user clicks a signup link on the page. When the user submits the form, we will display an alert and stop the form from submitting. We are also going to add a hover event to the slogan to fadeout and fadein an alternate slogan. Finally, we will add some animation to display an image when the page loads.
Requirements:For this lab, we will be adding on to the index page that we created in Lab 5.
Add the following html code to the page before the<hr>and :
<p><a href=”” id=”x_signuplink”><span id=”x_openclose”>+</span> Sign up for our newsletter</a></p>
<form name=”x_newsSignup” method=”post” action=”thanks.html” id=”x_newsSignup”>
<p><label>Name: <input type=”text” name=”x_uname”></label></p>
<p><label>Email address: <input type=”email” name=”x_email”></label></p>
<p><input type=”submit” value=”Sign Up”> </p>
</div>Hide the newSignup form when the page loads.
Add a click event to the signuplink anchor tag to do the following:
Use the slideToggle function to show or hide the newsSignup form.
If the openclose span contains a +, change the + to a -.
Otherwise, change the – to a +.
Be sure to cancel the link default action.
Add a hover action to the slogan element to do the following:
Fade out the element at a normal speed using linear easing
Once the text is faded out (hint, use a callback function), change the text to ‘Hand Picked Just for You’ and then fade it in slowly using the swing easing.
Fade out the element at fast speed using swing
Once it is faded out, change the text back to ‘The Power of Flowers’ and fade in slowly using linear easing.
Add the following element to the bottom of the html page below the footer:
<img id=”x_rose” src=”rose.jpg” alt=”Rose”>
(image file attached above)Add the following to the css file to position the rose as an absolute element inside the container div with opacity 0:
}Add animation in the document.ready function to move the rose element to a position of right: 100px and opacity: 1. When the page loads the rose should move into position from the right side and fade in slowly using the swing easing function.
Add a submit event to the form to do the following:
Display an alert message: “Thank you for registering”
Hide the newsSignup form
Fade the signuplink anchor tag to 30% opacity
Stop the default action to submit the form
Upload your files to the server. Test and submit the assignment.