TM 2nd qtr-2ndmeeting(java script-animations)

18
Java Script: Changing Images on hover Learning by examples: by: Engr. Esmeraldo T. Guimbarda Jr.

description

Java Script-Animations

Transcript of TM 2nd qtr-2ndmeeting(java script-animations)

Page 1: TM 2nd qtr-2ndmeeting(java script-animations)

Java Script: Changing Images on hover

Learning by examples:

by: Engr. Esmeraldo T. Guimbarda Jr.

Page 2: TM 2nd qtr-2ndmeeting(java script-animations)

Activity:1. Open Notepad++. Click on Start > All Programs > Notepad++ folder > Notepad++.

Page 3: TM 2nd qtr-2ndmeeting(java script-animations)

2. Create a new HTML file by clicking File > New, or pressing Ctrl+N on your keyboard.

Page 4: TM 2nd qtr-2ndmeeting(java script-animations)

3. Save the file as “animate.html”.

To save the file, go to File > Save As. Type “animate.html” in the File name box. Select Hypertext Markup Language file in the Save as type selection menu. Save the file in your desktop.

Page 5: TM 2nd qtr-2ndmeeting(java script-animations)

4. Type the basic skeleton code of an HTML document.

Page 6: TM 2nd qtr-2ndmeeting(java script-animations)

5. Define the title as “Animate image on hover with Javascript”.

Page 7: TM 2nd qtr-2ndmeeting(java script-animations)

6. Add the style tag <style> with type as text/css at the head tag <head> section below title tag <title> and create two(2) ID’s named smiley & poem.

Page 8: TM 2nd qtr-2ndmeeting(java script-animations)

7. Inside #smiley set padding to 0, both margin to auto,& text-align to center.

Page 9: TM 2nd qtr-2ndmeeting(java script-animations)

8. Inside #poem set width to 50%, both margin to auto, text-align to center, background color to red using RGB values and text color to yellow using hexadecimal values.

Page 10: TM 2nd qtr-2ndmeeting(java script-animations)

9. Inside body tag <body>, create a division tag <div> with division id as smiley

Page 11: TM 2nd qtr-2ndmeeting(java script-animations)

10. Inside division <div> id smiley, assign smile.png as your image.

Page 12: TM 2nd qtr-2ndmeeting(java script-animations)

11. Inside image tag <img>, assign bleh.png as your image when you hover your mouse over image smile.png.

Page 13: TM 2nd qtr-2ndmeeting(java script-animations)

12. Inside image tag <img>, assign smile.png again as your image when you hover out your mouse over image.

Page 14: TM 2nd qtr-2ndmeeting(java script-animations)

13. below the division(smiley). Create another division with division id as poem

Page 15: TM 2nd qtr-2ndmeeting(java script-animations)

14. Inside division <div> id poem, create a paragraph tag <p>. Inside the paragraph tag <p>type in the poem titled tickle as shown below

Page 16: TM 2nd qtr-2ndmeeting(java script-animations)

15. Save the file by clicking File > Save or pressing Ctrl + S on your keyboard.

Page 17: TM 2nd qtr-2ndmeeting(java script-animations)

16. Open the HTML file to your browser by clicking Run > Lunch in Chrome or Lunch in Firefox on your Notepad++

Page 18: TM 2nd qtr-2ndmeeting(java script-animations)

OUTPUT: