Skip to content

Commit 6e4475d

Browse files
committed
Add auto scrolling
1 parent 0de6889 commit 6e4475d

1 file changed

Lines changed: 38 additions & 8 deletions

File tree

‎index.html‎

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
<script src="{{ url_for('static',filename='js/leaderboard.js') }}"></script>
2020

2121
<script type="text/javascript" src="//gyrocode.github.io/jquery-datatables-pageLoadMore/1.0.1/js/dataTables.pageLoadMore.min.js"></script>
22+
2223
</head>
2324

25+
26+
2427
<BODY BGCOLOR="FFFFFF">
2528

2629
<!-- HTML generated using hilite.me -->
@@ -29,7 +32,12 @@
2932
<div class="filterGroup fontBigger" id="filters">
3033
</div>
3134

32-
<div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">import</span> <span style="color: #0e84b5; font-weight: bold">tensorflow</span> <span style="color: #008800; font-weight: bold">as</span> <span style="color: #0e84b5; font-weight: bold">tf</span>
35+
<button onclick="myFunction()" class="button">Click Here to go </button>
36+
37+
<div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;">
38+
<pre style="margin: 0; line-height: 125%">
39+
40+
<span style="color: #008800; font-weight: bold">import</span> <span style="color: #0e84b5; font-weight: bold">tensorflow</span> <span style="color: #008800; font-weight: bold">as</span> <span style="color: #0e84b5; font-weight: bold">tf</span>
3341

3442
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">main</span>():
3543

@@ -96,17 +104,36 @@
96104
model<span style="color: #333333">.</span>save(<span style="background-color: #fff0f0">&#39;model.h5&#39;</span>)
97105

98106
new_model <span style="color: #333333">=</span> keras<span style="color: #333333">.</span>models<span style="color: #333333">.</span>load_model(<span style="background-color: #fff0f0">&#39;model.h5&#39;</span>)
99-
100-
new_model<span style="color: #333333">.</span>evaluate(test_loader)
107+
108+
<span class="codeblock" id="hehe">
109+
new_model<span style="color: #333333">.</span>evaluate(test_loader)</span>
101110

102111
<span style="color: #008800; font-weight: bold">if</span> __name__ <span style="color: #333333">==</span> <span style="background-color: #fff0f0">&#39;__main__&#39;</span>:
103112
main()
104-
</pre></div>
113+
</pre>
114+
</div>
105115

116+
<div id="search_cont">
117+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
118+
survived not only five centuries
119+
</div>
106120

121+
<div id="last"> There is hope </div>
107122

108123
<script>
109124

125+
126+
function scrollTo(hash) {
127+
location.hash = "#" + hash;
128+
console.log(location.hash);
129+
}
130+
131+
function jump(h){
132+
var url = location.href; //Save down the URL without hash.
133+
location.href = "#"+h; //Go to the target element.
134+
history.replaceState(null,null,url); //Don't like hashes. Changing it back.
135+
}
136+
110137
function create_filter(name, items) {
111138
// document.getElementById("filters").innerHTML+=
112139
content = '<div class="filter">';
@@ -142,19 +169,20 @@
142169
return selected;
143170
}
144171

145-
var def_filters = {"Name": ['datapipeline', "rundata", "singleGPU"]}
172+
var def_filters = {"Name": ['datapipeline', "rundata", "singleGPU", "last"]}
146173

147174

148175
for (var key in def_filters) {
149176
if (def_filters.hasOwnProperty(key)) {
150-
console.log("hsi")
151177
create_filter(key, def_filters[key])
152178
}
153179
}
154180

155181
var color_default = 'rgb(255,255,255)'
156182
var color_selected = 'rgb(254,200,200)'
157183

184+
185+
158186
$("input.table_radio:radio").change(function(){
159187

160188
var spans = document.getElementsByClassName('codeblock');
@@ -163,9 +191,11 @@
163191
span.style.background = color_default;
164192
}
165193

166-
console.log(get_filters()['Name'])
167194
var span = document.getElementById(get_filters()['Name']);
168-
span.style.background = color_selected;
195+
span.style.background = color_selected;
196+
197+
var target = "#" + get_filters()['Name']
198+
$('html, body').animate({scrollTop:$(target).position().top}, 'slow');
169199
})
170200

171201
</script>

0 commit comments

Comments
 (0)