Programming in JavaScript – Week 8 Assignment

Create a Rollover Plugin

Starting with the downloadable assignment files, write the Javascript needed for the application. Use the book and lectures as a guide. In this exercise, you’ll create a plugin that displays a different image when the mouse is rolled over an image in a list of images

1.  Open the HTML and JavaScript files in the week 8 zip folder

Run this application to observe how it works.

2.  Review the code in the jquery.rollover.js file to see that it contains code for the standard plugin structure with the method name set to changeImage().

3.  Copy the code in the ready event handler of the rollover.js file into the each() method of the plugin. Then, modify the selector for the each() method in this copied code so its function is executed for each img element that’s a descendant of the element that the changeImage() method is executed on.

4.  Return to the rollover.js file, and replace the code in the ready event handler with a statement that calls the changeImage() method for the “image_rollovers” list.

5.  Add a script element for the jquery.rollover.js file to the HTML file before the script element for the rollover.js file. The application should now run just like it did before.

Add your first and last name to the title on the interface. For example: Jane Doe’s Image Gallery.

Create a document and paste in JS and/or HTML. Comment each code section with a detailed description of what it does. Zip all files for submission. Make sure images are included. Add a screenshot of the running application on your computer showing the time/date on your screen at the time of testing.

View your assignment rubric.

Title: Grantham Copyright - Description: Grantham Copyright 2018