-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathmain.js
More file actions
75 lines (67 loc) · 1.91 KB
/
main.js
File metadata and controls
75 lines (67 loc) · 1.91 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
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
71
72
73
$(document).ready(function(){
headerToggleInit();
$('#filter-options a').click(function(event){
console.log($(event.target).text())
});
function headerToggleInit(){
var open = false;
$('#filter-btn').click(function(){
open = headerToggle(open);
});
$("#filter-options a").css( "width", 0 );
}
function headerToggle(state){
if(state === true) {
$("#filter-indicator").animate({width: 80}, 250);
$("#filter-options a").animate({width: 0}, 500);
return false;
} else {
$("#filter-indicator").animate({width: 0}, 250);
$("#filter-options a").animate({width: 80}, 500);
return true;
}
}
var mastPhotoResize = function() {
var photoSelector = function() {
$( window ).resize(function() {
if ($(window).width() <= 600 && $('#mast-img .img-responsive, #feat-img .img-responsive').attr('src').match(/cover.jpg/) =="cover.jpg")
{
$('#mast-img .img-responsive, #feat-img .img-responsive').each(function() {
var src = $(this).attr("src").replace("-cover.jpg", ".jpg");
$(this).attr("src", src);
});
}
else if ($(window).width() >= 600 && $('#mast-img .img-responsive, #feat-img .img-responsive').attr('src').match(/cover.jpg/) != "cover.jpg")
{
$('#mast-img .img-responsive, #feat-img .img-responsive').each(function() {
var src = $(this).attr("src").match(/[^\.]+/) + "-cover.jpg";
$(this).attr("src", src);
})
}
});
}
if ($(window).width() <= 600)
{
$('#mast-img .img-responsive, #feat-img .img-responsive').each(function() {
var src = $(this).attr("src").replace("-cover.jpg", ".jpg");
$(this).attr("src", src);
});
photoSelector();
}
else
{
$( window ).resize(function() {
photoSelector();
});
}
};
mastPhotoResize();
});
$(window).load(function(){
var $container = $('#masonry');
// initialize
$container.masonry({
itemSelector: '.item',
transitionDuration: 0
});
});