forked from npofopr/site-dlya-slabovidyashith
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
70 lines (60 loc) · 2.11 KB
/
script.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
67
68
69
70
$(document).ready(function () {
//sv_settings
var selector = '#content, #content *, .navbar, .navbar *, .nav, .nav*, .container, .container *, body';
//-------------
$('.fs-outer button').click(function () {
$(selector).css('font-size', $(this).css('font-size'));
$.cookie('font-size', $(this).attr('id'));
$('.fs-outer button').removeClass('active');
$(this).addClass("active");
});
$('.cs-outer button').click(function () {
$(selector).css('color', $(this).css('color'));
$(selector).css('background', $(this).css('background'));
$.cookie('cs', $(this).attr('id'));
$('.cs-outer button').removeClass('active');
$(this).addClass("active");
});
$('.img-outer button').click(function () {
if ($.cookie('img') != 'on') {
$('img').css('display', 'none');
$.cookie('img', 'on');
$('#img-onoff-text').text(' Включить');
$(this).addClass("active");
} else
{
$('img').css('display', 'block');
$.cookie('img', 'off');
$('#img-onoff-text').text(' Выключить');
$(this).removeClass("active");
}
});
if ($.cookie('sv_on') == 'true') {
$('#sv_on').addClass('active');
$('#sv_settings').css('display', 'block');
if ($.cookie('font-size') !== null) {
$('#' + $.cookie('font-size')).click();
}
if ($.cookie('cs') !== null) {
$('#' + $.cookie('cs')).click();
}
}
$('#sv_on').click(
function () {
if ($.cookie('sv_on') != 'true') {
$.cookie('sv_on', 'true');
if ($.cookie('font-size') == "null") {
$('.fs-n').click();
}
if ($.cookie('cs') == "null") {
$('.cs-bw').click();
}
}
else
{
$.cookie('sv_on', 'false');
}
location.reload();
}
);
});