-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
45 lines (41 loc) · 1.08 KB
/
Copy pathmain.js
File metadata and controls
45 lines (41 loc) · 1.08 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
var panels = ['home', 'publications', 'research', 'service', 'funds'];
function showPanel(index) {
for (var i = 0; i < panels.length; i++) {
if (i == index) {
$('#' + panels[i]).show();
}
else {
$('#' + panels[i]).hide();
}
}
}
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
$(document).ready(function () {
panel = parseInt(getUrlParam("panel"));
if(panel>=0&&panel<5){
showPanel(panel);
}
else{
showPanel(defaultPanel);
}
$('#morenews').hide();
});
$('#morebtn').click(function (e) {
$('#morenews').slideToggle();
if ($('#morebtn').html() == 'More...') {
$('#morebtn').html('Less');
}
else {
$('#morebtn').html('More...');
}
});
// $('document').ready(function () {
// for (var i = 1; i < panels.length; i++) {
// $('#' + panels[i]).load(panels[i] + '.html');
// }
// });