fixes item_url. sets image height
This commit is contained in:
parent
56cd480231
commit
8f612dac0d
|
@ -8,7 +8,7 @@ $this->headLink()->appendStylesheet($this->assetUrl('css/gallery.css', 'ImageGal
|
|||
|
||||
<div class="archive-gallery">
|
||||
<div class="source-link">
|
||||
<a href="<?= $item_url ?>">Source</a>
|
||||
<a href="">Source</a>
|
||||
</div>
|
||||
|
||||
<section id="<?= $gallery_id ?>"
|
||||
|
@ -27,11 +27,12 @@ $this->headLink()->appendStylesheet($this->assetUrl('css/gallery.css', 'ImageGal
|
|||
<img class="gallery__img"
|
||||
style=""
|
||||
src="<?= $image['media_url'] ?>"
|
||||
alt="<?= $image['media_url'] ?>"
|
||||
item_url="<?= $image['item_url'] ?>"
|
||||
alt=""
|
||||
/>
|
||||
<label for="<?= $img_id ?>" class="gallery__thumb">
|
||||
<img src="<?= $image['media_url'] ?>"
|
||||
alt="<?= $image['media_url'] ?>"
|
||||
alt=""
|
||||
item_url="<?= $image['item_url'] ?>"
|
||||
onclick="updateSourceURL(this)"
|
||||
/>
|
||||
|
@ -58,14 +59,10 @@ function updateSourceURL(thumbnail){
|
|||
.find('.source-link')
|
||||
.find('a').prop('href', $(thumbnail).attr('item_url'));
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
$('.archive-gallery').each(function(i, el){
|
||||
var first_thumbnamil = $(el).find('.gallery__thumb:first')
|
||||
.find('img');
|
||||
updateSourceURL(first_thumbnamil)
|
||||
|
||||
|
||||
var first_thumbnail = $(el).find('.gallery__img:first')
|
||||
updateSourceURL(first_thumbnail)
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -76,8 +73,10 @@ jQuery(document).ready(function() {
|
|||
gallery_image_height = $(this).height();
|
||||
}
|
||||
});
|
||||
$('section.gallery').css('padding-top', gallery_image_height)
|
||||
//$(".gallery__thumb:first-of-type").css('margin-left', 0)
|
||||
//$(".gallery__thumb:last-of-type").css('margin-right', 0)
|
||||
$( ".gallery__img" ).each(function( index ) {
|
||||
$(this).css('height', gallery_image_height)
|
||||
});
|
||||
$('section.gallery').css('padding-top', gallery_image_height)
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue