-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.js
66 lines (50 loc) · 1.83 KB
/
content.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
var host = 'https://damnty.github.io/PortuGram/';
var url = window.location.pathname;
$(document).ready(function() {
/* ---------------------------------------------------------------------------- LEVELONE */
/* ---------------------------------------------- WEBSITE HEIGHT CONTROL */
// var height_resize = function() {
// $('#content').css('min-height', '600px');
// $('#left').css('min-height', '600px');
// window.setTimeout(height_control, 1);
// }
//
// var test = function() {
// alert('hello');
// }
//
// var height_control = function() {
//
// var content_height = $('#content').height();
// var left_height = $('#left').height();
//
// if (content_height > left_height) {
// var new_height = content_height;
// } else {
// var new_height = left_height;
// }
// $('#left').css('min-height', new_height + 'px');
// $('#content').css('min-height', new_height + 'px');
// $('#right').css('min-height', (new_height + 20) + 'px');
// }
// height_control();
// $(document).on('click', '#content .choices li', height_resize);
/* ---------------------------------------------- HEADER LINK */
$(document).on('click', '#menu .header', (function() {
window.location.href = host;
}));
/* ---------------------------------------------- CATEGORY ON CLICK ACTIVE SWITCH */
$(document).on('click', '#menu ul li', (function() {
$(this).addClass('active')
$(this).siblings().removeClass();
}));
/* ---------------------------------------------- CHOICE SWITCHER */
$(document).on('click', 'li[data-opt]', (function() {
var target = $(this).data('opt');
$(this).addClass('active')
$(this).siblings().removeClass();
$('div[data-opt]').hide();
$('div[data-opt=' + target + ']').show();
}));
// ---------------------------------------------- CLOSING THE BRAKETS
});