-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathhead-lightbox-library.php
More file actions
46 lines (41 loc) · 1.79 KB
/
Copy pathhead-lightbox-library.php
File metadata and controls
46 lines (41 loc) · 1.79 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
<?php
global $exhibits_to_show;
if (!$guessurl = site_url())
$guessurl = wp_guess_url();
$baseuri = $guessurl;
$exhibituri = $baseuri . '/wp-content/plugins/datapress';
$linkstring = "";
$overlaystring = "";
foreach ($exhibits_to_show as $exhibit) {
$exhibitid = $exhibit->get('id');
$linkstring .= "$('a.exhibit_link_$exhibitid').fancybox({ 'padding':0, 'frameWidth': $(window).width()*.9, 'frameHeight': $(window).height()*.9 });\n";
$overlaystring .= "cover = $('div[id=cover_$exhibitid]');\n";
$overlaystring .= "teaser = $('div[id=teaser_$exhibitid]');\n";
$overlaystring .= "teaserpos = teaser.position();\n";
$overlaystring .= "if (teaserpos) {\n";
$overlaystring .= "cover.css('top', teaserpos.top);\n";
$overlaystring .= "cover.css('left', teaserpos.left);\n";
$overlaystring .= "cover.css('height', teaser.height());\n";
$overlaystring .= "cover.css('width', teaser.width());\n";
$overlaystring .= "}\n";
}
?>
<script src="<?php echo $exhibituri ?>/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="<?php echo $exhibituri ?>/js/jquery.fancybox-1.2.1.pack.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo $exhibituri ?>/css/jquery.fancybox.css" type="text/css" media="screen"/>
<script type="text/javascript">
$(document).ready(function() {
<?php echo $linkstring ?>
});
</script>
<!-- Lightbox teaser overlay stuff -->
<link rel="stylesheet" type="text/css" href="<?php echo $exhibituri ?>/css/overlay.css" />
<script type="text/javascript">
$(document).ready(function() {
var cover;
var teaser;
var teaserpos;
<?php echo $overlaystring ?>
});
</script>
<!-- End lightbox teaser overlay stuff -->