-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmason-hatchet.js
executable file
·51 lines (48 loc) · 1.63 KB
/
mason-hatchet.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
$(function(){
/*
$('#photo-grid-container').masonry({
// options
itemSelector : '.picture'
});
*/
var $container = $('#photo-grid-container');
$container.imagesLoaded( function(){
$container.masonry({
itemSelector : '.picture'
});
});
var inserted_hover_box;
$('.picture img').bind({mouseenter: function(){
var div_element = document.createElement("div");
div_element.setAttribute('class', 'hatchet-gallery-hover-box');
var parentContainer = this.parentNode;
//var text = $(this).parent().attr('title');
var text = $(this).parent().next().html();
if(text.indexOf('Photo') != -1)
div_element.setAttribute("style", "height:"+($(this).height()+15)+"px;");
else
div_element.setAttribute("style", "height:"+($(this).height()+0)+"px;");
$(this).css('z-index', '11');
text = text.replace('|', '<br />');
div_element.innerHTML = '<p style="font-size:12px;color:#777;padding:5px 0px 5px 5px;position:absolute;bottom:-10px">'+text+'</p>';
inserted_hover_box = parentContainer.insertBefore(div_element, this.nextSibling);
},
mouseleave: function(){
$(inserted_hover_box).remove();
$(this).css('z-index', '0');
}});
});
$(document).ready(function(){
$(".fancy-img").fancybox({
beforeShow: function(){
var hatchet_cap = $(this.elemenet).find('img');
var img_alt = $(this.element).next('.photo-names').prev().find('img').attr('alt');
this.title = img_alt + ' ' + $(this.element).next('.photo-names').text();
},
helpers: {
title : {
type : 'inside'
}
}
});
});