Created
May 22, 2014 16:46
-
-
Save dsalvagni/ba263fae7ef67185b230 to your computer and use it in GitHub Desktop.
Lightbox template file for a blog post sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $style = 'width: '.$this->getData('width').'px; height:'.$this->getData('height').'px; margin:-'.ceil(($this->getData('height')+4)/2).'px 0 0 -'.ceil(($this->getData('width')+4)/2) .'px;'; ?> | |
<div class="lightbox" id="lightbox" style="<?php echo $style ?> <?php echo ($this->getData('display')=='show') ? ' display:block;' : ' display:none;' ?>" ?> | |
<a href="<?php echo $this->getData('bannerUrl'); ?>"> | |
<img src="<?php echo $this->getData('imgUrl'); ?>"> | |
</a> | |
<div class="lightbox-close" onclick="closeLightBox()">X</div> | |
</div> | |
<div class="lightbox-shadow" id="lightboxShadow" onclick="closeLightBox()" style="<?php echo ($this->getData('display')=='show') ? ' display:block;' : ' display:none;' ?>"></div> | |
<script type="text/javascript"> | |
function closeLightBox() | |
{ | |
document.getElementById('lightboxShadow').style.display='none'; | |
document.getElementById('lightbox').style.display='none'; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment