This repository has been archived by the owner on Jan 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
52 lines (51 loc) · 1.43 KB
/
index.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
var winWidth=0;
var winHeight=0;
function findDimensions()
{
if(window.innerWidth)
winWidth=window.innerWidth;
else if((document.body)&&(document.body.clientWidth))
winWidth=document.body.clientWidth;
if(document.documentElement && document.documentElement.clientWidth)
{
winWidth=document.documentElement.clientWidth;
}
}
findDimensions();
window.onresize=findDimensions;
function showHeadBlock(){
$(".blog-title").addClass("blog-title-active");
if(winWidth>1057){
$(".move-block").animate({marginLeft:'-330px'},'fast');
}else{
$(".move-block").animate({left:'-330px'},'fast');
}
$("#secondary").animate({right:'0'},'fast');
$(".side-click").removeClass("icon-arrow-down");
$(".side-click").addClass("icon-cross");
}
function hideHeadBlock(){
$(".blog-title").removeClass("blog-title-active");
$(".move-block").animate({left:'0px',marginLeft:'0px'},'fast');
$("#secondary").animate({right:'-330px'},'fast');
$(".side-click").removeClass("icon-cross");
$(".side-click").addClass("icon-arrow-down");
}
/*
$(document).ready(function(){
$('.icon-arrow-down').click(function(){
showHeadBlock();
});
$('.icon-cross').click(function(){
hideHeadBlock();
});
});
*/
$(document).ready(function(){
$('body').delegate('.icon-arrow-down','click',function(){
showHeadBlock();
});
$('body').delegate('.icon-cross','click',function(){
hideHeadBlock();
});
});