Turn in:
- A folder named your "Lastname, Firstname" containing:
Details:
Now that you have a feel for how Javascript works let's see if you can do a little more on your own.
In this exercise, we'll create a JavaScript drop down menu that is compatible with multiple browsers.
XHTML:
- This assignment is case sensitive. Be mindful of what you type.
- Create a web page and save it as index.html
- Create a table with 1 row and 5 columns.
(mainMenu)
- Table width: 700, cellpadding: 1, cellspacing: 1, border: (initially set as 1, when finished, change to 0)
- Add style="vertical-align:top;" to each td
- id: mainMenu
- Put the following text in each td: | Home | About | Products | Services | Help |
- Add an <a> tag around Home that points to index.html
- Create a second table with 3 rows and 1 column.
(aboutSubMenu)
- Table cellpadding: 1, cellspacing: 1, border: (initially set as 1, when finished, change to 0)
- id: aboutSubMenu
- Put the following text in each td: | History | Mission | Vision |
- Add <a> tags around each of the words that points to history.html, mission.html, etc.
- Create a third table with 5 rows and 1 column.
(productsSubMenu)
- Table cellpadding: 1, cellspacing: 1, border: (initially set as 1, when finished, change to 0)
- id: productsSubMenu
- Put the following text in each td: | Product Listing | Order | Downloads | Trials | Accessories |
- Add <a> tags around each of the words that points to productListing.html, order.html, etc.
- Create a fourth table with 3 rows and 1 column.
(servicesSubMenu)
- Table cellpadding: 1, cellspacing: 1, border: (initially set as 1, when finished, change to 0)
- id: servicesSubMenu
- Put the following text in each td: | What we offer | Pricing | Guarantee |
- Add <a> tags around each of the words that points to whatWeOffer.html, pricing.html, etc.
- Create a fifth table with 3 rows and 1 column.
(helpSubMenu)
- Table cellpadding: 1, cellspacing: 1, border: (initially set as 1, when finished, change to 0)
- id: helpSubMenu
- Put the following text in each td: | Contact Us | Find a Location | FAQ |
- Add <a> tags around each of the words that points to contactUs.html, findLocation.html, etc.
CSS:
- Create an external style sheet called mystyles.css
- Add a link tag to index.html that points to mystyles.css
- Create a class: main
- position: absolute
- top: 10px
- left: 10px
- height: 30px
- background-color: #ddddff
- font-family: Arial, Helvetica, sans-serif
- font-size: 10pt
- color: navy
- Add a class attribute to the mainMenu <table> tag that points to this class.
- Create a class: about
- position: absolute
- top: 36px
- left: 140px
- display: none
- background-color: #ddddff
- Add a class attribute to the aboutSubMenu <table> tag that points to this class.
- Create a class: products
- position: absolute
- top: 36px
- left: 260px
- display: none
- background-color: #ddddff
- Add a class attribute to the productsSubMenu <table> tag that points to this class.
- Create a class: services
- position: absolute
- top: 36px
- left: 445px
- display: none
- background-color: #ddddff
- Add a class attribute to the servicesSubMenu <table> tag that points to this class.
- Create a class: help
- position: absolute
- top: 36px
- left: 596px
- display: none
- background-color: #ddddff
- Add a class attribute to the helpSubMenu <table> tag that points to this class.
- Create a class: subMenuA
- text-decoration: none
- font-family: Arial, Helvetica, sans-serif
- color: navy
- font-size:10pt
- Add a class attribute to every <a> tag that points to this class.
- Create a class: subMenuTd
- border-bottom: 1px solid navy
- width: 110px
- In the four subMenu tables, add a class attribute to every <td> tag that points to this class.
- Apply this style to h1
JavaScript:
- JavaScript is case sensitive... be mindful of what you type.
- When you add JavaScript, if the browser says it has restricted ActiveX controls, Click to 'Allow Blocked Content...'
- In the mainMenu table:
- Leave the Home <td> tag as is.
- Add the following onmouseover event handler to the other four <td> tags, changing the bolded text to match the appropriate subMenu table name:
- onmouseover="document.getElementById('aboutSubMenu').style.display='block';"
- Add the following onmouseout event handler to the other four <td> tags, changing the bolded text to match the appropriate subMenu table name:
- onmouseout="document.getElementById('aboutSubMenu').style.display='none';"
- In the other four subMenu tables:
- Add the following onmouseover event handler to every subMenu <table> tag, changing the bolded text to match the appropriate subMenu table name:
- onmouseover="document.getElementById('aboutSubMenu').style.display='block';"
- Add the following onmouseout event handler to every subMenu <table> tag, changing the bolded text to match the appropriate subMenu table name:
- onmouseout="document.getElementById('aboutSubMenu').style.display='none';"
- For every <a> tag on the page::
- Add the following onmouseover event handler to every <a> tag:
- onmouseover="this.style.color='#ffffff'"
- Add the following onmouseout event handler to every <a> tag:
- onmouseout="this.style.color='navy'"
- Image showing the different parts of the solved exercise (shows rollovers): Exercise
15
Note: This project is to be done by hand/hard-coding. No editors!
|