大事记bug修改
parent
453e07471f
commit
3ead1cad37
|
@ -941,17 +941,11 @@
|
|||
.history .img>span {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
opacity: 0;
|
||||
opacity: 1;
|
||||
overflow: hidden;
|
||||
transition: all .6s;
|
||||
}
|
||||
|
||||
.history .img>span.active {
|
||||
height: auto;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.history .img img {
|
||||
width: 100%;
|
||||
min-height: 500px;
|
||||
|
|
|
@ -182,11 +182,6 @@ $(function(){
|
|||
prevEl: '.history-swiper-bg .swiper-button-prev',
|
||||
},
|
||||
});
|
||||
|
||||
$('.history .img>span').eq(0).addClass('active');
|
||||
$(document).on('click','.history-swiper .swiper-slide',function() {
|
||||
$('.history .img>span').eq($(this).index()).addClass("active").siblings().removeClass('active');
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ foreach ($items as $item) {
|
|||
$eventList = json_decode($info['imgs'], true);
|
||||
{/php}
|
||||
{foreach $eventList as $event}
|
||||
<span style="cursor: pointer" data-src="{$event.src ?? ''}" class="show-event-img">
|
||||
<span style="cursor: pointer" data-src="{$event.src ?? ''}" data-title="{$event.title ?? ''}" class="show-event-img">
|
||||
{$event.title ??''}
|
||||
</span><br>
|
||||
{/foreach}
|
||||
|
@ -80,25 +80,19 @@ foreach ($items as $item) {
|
|||
</div>
|
||||
</div>
|
||||
<div class="img">
|
||||
{foreach $yearList as $year => $months}
|
||||
{foreach $months as $month => $info}
|
||||
{php}
|
||||
$eventList = json_decode($info['imgs'], true);
|
||||
{/php}
|
||||
{foreach $eventList as $k => $event}
|
||||
{if ($k == 0) }
|
||||
<span><img id="event-img" src="{$event.src ?? ''}" alt="{$event.title ?? ''}"></span>
|
||||
{php}break;{/php}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
<span><img id="event-img" src="" alt=""></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
let baseUrl = $('.history-swiper .swiper-slide').eq(0).find('.show-event-img').eq(0).attr('data-src');
|
||||
let baseTitle = $('.history-swiper .swiper-slide').eq(0).find('.show-event-img').eq(0).attr('data-title');
|
||||
$('#event-img').attr('src', baseUrl);
|
||||
$('#event-img').attr('alt', baseTitle);
|
||||
$('body').on('click', '.show-event-img',function () {
|
||||
let src = $(this).attr('data-src');
|
||||
let title = $(this).attr('data-title');
|
||||
$('#event-img').attr('src', src);
|
||||
$('#event-img').attr('alt', title);
|
||||
})
|
||||
</script>
|
Loading…
Reference in New Issue