forked from reaperhulk/Google-Lightboxer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslideshow.js
53 lines (51 loc) · 1.4 KB
/
slideshow.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
/*
to capture and re-colorbox when sizes and types are changed on the left sidebar we need to bind a live
event. i'd rather watch for div content changes but i'm not sure how to do that at this time.
*/
triggerColorBox = function() {
$('#ImgContent a > img').parent().colorbox({
href:function() {
href = $(this).attr('href');
parsedUrl = href.split('?')[1].split('&')[0].split('=')[1];
return parsedUrl;
},
title:function() {
href = $(this).attr('href');
parsedUrl = href.split('?')[1].split('&')[0].split('=')[1];
var name = parsedUrl.split('/').pop().split('.');
name.pop();
parentId = $(this).parent().attr('id');
var textId = '#'+parentId.replace('tDataImage','tDataText');
metadata = $(textId);
name = '<div style="float:right;"><a href="'+parsedUrl+'">'+name.join()+'</a></div>'+metadata.html()
return name;
},
rel:'gImages',
current:"{current}/{total}",
maxWidth:'98%',
maxHeight:'98%',
minWidth:'200',
minHeight:'200',
transition: 'fade',
speed: 150
})
}
$(window).load(function() {
triggerColorBox();
$('#ImgContent a').live('mouseover',function(event) {
if(event.metaKey) {
event.stopPropagation();
$(this).removeClass('cboxElement');
} else {
triggerColorBox();
}
return false;
})
$('#ImgContent a').live('click',
function(event) {
if(event.metaKey) {
event.stopPropagation();
$(this).removeClass('cboxElement');
}
})
})