View the step-by-step solution to: New Perspectives on JavaScript tutorial 4 case 1 help needed

New Perspectives on JavaScript
tutorial 4 case 1 help needed

/* New Perspectives on JavaScript, 2nd Edition
Tutorial 4
Case Problem 1
Date: Jillian Corder
March 1, 2012 Filename: jemenus.js ------------------------------------------------------------Function List:
Initializes the contents of the printer.htm Web page, locating
the tab menus and assigning event handler to the tabs.
Shows the currently-select tab menu, bring it to the top
of the stack
------------------------------------------------------------Global Variable List:
An object variable pointing to the currently selected tab
A variable containing maximum z-index value among the tab lists
var currentTab = null;
var maxZ = 1;
window.onload = setTabs;
function setTabs() {
var menuTabs = new Array();
var allElems = document.getElementsByTagName("*")
for(var i=0; i < allElems.length; i++){
if(allElems.className == 'tab'){
currentTab = menuTabs[0];
for(var i = 0; i < menuTabs.length; i++){
menuTabs[i].onclick = showTab;
function showTab() { = "#FFFFFF";
tabList = this.getElementsByTagName("ul")[0]; = maxZ;
currentTab = this; = "rgb(221, 221, 255)";

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors and customizable flashcards—available anywhere, anytime.


Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access or to earn money with our Marketplace.

    Browse Documents
  • 890,990,898

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
  • 890,990,898


    Browse existing sets or create your own using our digital flashcard system. A simple yet effective studying tool to help you earn the grade that you want!

    Browse Flashcards