-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIngrate.php
More file actions
107 lines (93 loc) · 2.05 KB
/
Ingrate.php
File metadata and controls
107 lines (93 loc) · 2.05 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!doctype html>
<!--
Server:
Task: integrate Clone template with dropdown menu
-->
<head>
<style>
body{
margin:0px;
}
#leftMenu{
width:15%;
min-width:150px;
}
#leftMenu>details{
}
#leftMenu>details>summary{
cursor:pointer;
background:#DFEFFF;
Margin:6px;
Padding:8px;
}
#leftMenu>details>summary:hover{
background:#EFEFEF;
}
#leftMenu>details>a{
display:block;
text-decoration:none;
color:#000;
font-size:14px;
margin:3px 6px 3px 18px;
padding:4px;
background:#efefef;
}
#leftMenu>details>a:hover{
background:#DFEFFF;
font-weight:bold;
}
</style>
<title></title>
<link rel="" href="">
<script>
</script>
</head>
<body>
<template id="temp">
<div id="leftMenu">
<details>
<summary></summary>
<a href="#"></a>
<a href="#"></a>
</details>
</div>
</template>
<script>
//DATA JASON
var arg=
[
{summary:"Template",a:"template",href:"http://www.scriptreference.com/test/Codeblock/elementtut.php"},
{summary:"Dropdown Menu",a:"subCatagory 2",href:"http://www.scriptreference.com/test/Codeblock/dropdown.php"},
{summary:"Slider",a:"input-element",href:"http://www.scriptreference.com/test/Codeblock/form-slider.php"},
{summary:"Catagory 4",a:"subCatagory 4",href:""},
{summary:"Catagory 5",a:"subCatagory 5",href:""},
];
/* var voodo=
[
{summary:"First",a:"template",href:"#"},
{summary:"Second",a:"subCatagory 2",href:"#"},
{summary:"Panck",a:"vodo",href:"#"},
{summary:"Forth",a:"subCatagory 4",href:"#"},
{summary:"Fith",a:"subCatagory 5",href:"#"},
];
*/
var template=document.querySelector('#temp');
//FUNCTION DECLARATION
var Itt = function($templ,$arr){
for(var i=0;i<$arr.length;i++){
var row=$arr[i];
var clone= $templ.content.cloneNode(true);
var summary= clone.querySelectorAll('div#leftMenu > details >summary');
summary[0].innerHTML=row.summary;
var a= clone.querySelectorAll("div#leftMenu > details >a");
a[0].innerHTML=row.a;
a[0].href=row.href;
$templ.parentNode.appendChild(clone);
}
document.write("<hr>");
}
Itt(template,arg);
Itt(template,voodo);
</script>
</body>
</html>