View Code? Open in Web Editor
NEW
This project forked from fewd-puffin/w02d01-jq-lab
HTML 33.25%
JavaScript 18.43%
CSS 48.32%
w02d01-jq-lab's Introduction
Lets practice some jQuery!
- Fork and clone this repo
- Open up the files in your text editor
- Open
index.html
in your browser
- Take a look at what code is already given. Theres a bunch going on here!
- Open up
main.js
and begin work
- When you click on '.gallery-tile'
- Get the background image of 'this' gallery-tile
- Set '#main-img' background image to the image
- When you click on a '.tab'
- Select the element with the class of 'selected' and remove the class 'selected'
- Add the class 'selected' to 'this' element
- Select the '#tab-conent' element
- If 'this' tab has an id of 'fewd' set the text of the '#tab-content' to the fewdText
- If it has an id of 'js' set it to the jsText
- If it has an id of 'wdi' set it to the wdiText
- HINT: use attr to get the id of the element
- When you click on '#jackie'
- Select '#jackie-info' and toggle the class 'show'
- When you click on 'trevor'
- Select 'trevor-info' and toggle the class 'show'
BONUS (this will be a tough one!)
- When the page loads, set the #main-img to a random image from the '.gallery-tile's
- HINT: Look at Math.random()
w02d01-jq-lab's People
Contributors
Watchers