#Task 1: ImagesPreviewer
-
Given the HTML
index.html
write JavaScript functioncreateImagesPreviewer(selector, items)
in filescripts.js
-
The function accepts two parameters:
- Selector
- The selector of the DOM element, where the previewer must be generated in
- It can be any CSS3 selector (
#id
,.class
,NODE_NAME
)
- Items
- An array of objects
- Every object in the array has two mandatory properties:
- title - the title of the image
- url - a path to the image (JPG/PNG)
- Selector
-
The execution of the
createImagesPreviewer(selector, items)
function should result as follows: -
Images in the list (on the right) have some properties:
- The title and the image must have a parent with class
image-container
- When
hovered
- When
unhovered
- They should return to their default background color
- When
clicked
- The title and the image must have a parent with class
-
The big image and title on the left must have a parent with class
image-preview
-
The filter should provide functionality for filtering the images on the list of images (on the right)
-
Constraints:
- You are allowed only to edit the contents of the file "scripts.js"
- You are NOT allowed to edit the contents of the HTML and/or the CSS files
-