-
Notifications
You must be signed in to change notification settings - Fork 0
/
selsubcat.html
96 lines (75 loc) · 2.72 KB
/
selsubcat.html
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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<script src="architect://architect.js"></script>
<link rel="stylesheet" href="lib/BlackBerry-JQM-all.css" />
<script src="lib/BlackBerry-JQM-all.js"></script>
<script type="text/javascript" src="lib/app.js"></script>
<script type="text/javascript" src="js/category.js"></script>
<style>
.thumbnail{
position:relative;
width:80px;
left:10px;
top:15px;
}
#main{
width: 100%;
height: 100%;
overflow: scroll;
}
</style>
</head>
<body style="overflow:scroll;" >
<div id="main">
<div id="page1" data-role="page" data-theme="a">
<!-- This is how you set up your tab overflow menu (left side panel) -->
<div data-role="header" data-theme="a">
<a onClick="backclicked()" data-role="button">Back</a>
<h1>Sub Category</h1>
</div><!-- /header -->
<div data-role="content">
<div id="wordlist">
<ul data-filter="true" data-role="listview" data-divider-theme="a" id="wordlistul" >
</ul>
</div>
<!-- Put your page content here -->
</div><!-- /content -->
</div>
</div><!-- /page -->
<script>
//AR.context.destroyAll();
function backclicked(){
location.href="selcat.html";
}
var selcat = localStorage.selcat;
//console.log(category);
for(var i=0; i<category.response.categories[selcat].categories.length;i++){
var name = category.response.categories[selcat].categories[i].name;
$("#wordlist ul").append('<li><a onClick="click'+selcat+'_'+i+'()"><img src="img/category/'+selcat+'.'+i+'.png" alt="list thumbnail" class="thumbnail"><h1 style="position:relative;top:25px;">'+name+'</h1><p style="visibility:hidden;"></p></a></li>');
console.log('function click'+selcat+'_'+i+'(){localStorage.selcat='+selcat+';localStorage.selsubcat='+i+';selsubsubcat=-1;location.href="browser.html;"}');
}
$("#wordlist li").click(function () {
// this is the dom element clicked
index = $("#wordlist li").index(this);
selsubcat = index;
localStorage.selsubcat = index;
if(category.response.categories[selcat].categories[selsubcat].categories.length == 0){
localStorage.selsubsubcat = -1;
location.href="browser.html";
}else{
location.href="selsubsubcat.html";
}
});
var name = "Mayur";
if(name.length<18){
for(l=name.length;l<18;l++){
name = name +' ';
}
}
console.log(name.length);
console.log(name);
</script>
</body>
</html>