-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu_load.js
91 lines (68 loc) · 2.89 KB
/
menu_load.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// going to make a div with html in it and add it to the div in the page using append
// menu items: contact, calendar (use google calendar link so it stays up to date)
window.onload = function()
{
// selects the menu div and creates the unordered list
const menu_div = document.getElementById("menu");
let list = document.createElement('ul');
// home page
// creates home page menu elements
let home_element = document.createElement('li');
let home = document.createElement('a');
let home_text = document.createTextNode("Home");
// adds data to home page link elements
home_element.appendChild(home);
home.appendChild(home_text);
home_element.title = "Home";
home.href = "index.html";
// adds home page link to menu
list.appendChild(home_element);
// sponsors page
// creates sponsors page menu elements
let sponsors_menu_element = document.createElement('li');
let sponsors_page_link = document.createElement('a');
let sponsors_menu_text = document.createTextNode("Sponsors");
// adds data to sponsors page link elements
sponsors_menu_element.appendChild(sponsors_page_link);
sponsors_page_link.appendChild(sponsors_menu_text);
sponsors_menu_element.title = "Sponsors";
sponsors_page_link.href = "sample_sponsors_page.html"
// adds sponsors page link to menu
list.appendChild(sponsors_menu_element);
// history page
// creates history page menu elements
let history_menu_element = document.createElement('li');
let history_page_link = document.createElement('a');
let history_menu_text = document.createTextNode("History");
// adds data to history page link elements
history_menu_element.appendChild(history_page_link);
history_page_link.appendChild(history_menu_text);
history_menu_element.title = "History";
history_page_link.href = "history.html";
// adds history page to menu elements
list.appendChild(history_menu_element);
// building fund page
// creates building page menu elements
let building_menu_element = document.createElement('li');
let building_page_link = document.createElement('a');
let building_menu_text = document.createTextNode("Building Fund");
// adds data to history page link elements
building_menu_element.appendChild(building_page_link);
building_page_link.appendChild(building_menu_text);
building_menu_element.title = "Building Fund";
building_page_link.href = "building_fund.html";
// adds history page to menu elements
list.appendChild(building_menu_element);
// adds all menu elements to the page
menu_div.appendChild(list);
}
/*
let link_text = document.createTextNode(businessName);
new_link.appendChild(link_text);
new_link.title = ";
let new_link = document.createElement('a');
let link_text = document.createTextNode(businessName);
new_link.appendChild(link_text);
new_link.title = businessName;
new_link.href = website
*/