From abc855e633c1886d142e4da5793da6829def3fbe Mon Sep 17 00:00:00 2001 From: filesite Date: Tue, 7 May 2024 12:42:18 +0000 Subject: [PATCH] improve user index image load --- themes/tajian/views/site/myindex.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/themes/tajian/views/site/myindex.php b/themes/tajian/views/site/myindex.php index 0845e21..7dc69fe 100644 --- a/themes/tajian/views/site/myindex.php +++ b/themes/tajian/views/site/myindex.php @@ -39,6 +39,7 @@ eof; $videoExts = array('url'); if (!empty($viewData['tags'])) { //显示tags分类 + $tagIndex = 0; foreach($viewData['tags'] as $id => $item) { //输出分类名称 @@ -68,9 +69,9 @@ eof; $pubDate = date('m/d', $file['fstat']['ctime']); - $imgSrc = $index < 8 ? " src=\"{$snapshot}\"" : ''; - $imgAlt = $index < 8 ? " alt=\"{$title}\"" : ''; - $imgCls = $index < 8 ? '' : 'lazy'; + $imgSrc = $tagIndex == 0 && $index < 8 ? " src=\"{$snapshot}\"" : ''; + $imgAlt = $tagIndex == 0 && $index < 8 ? " alt=\"{$title}\"" : ''; + $imgCls = $tagIndex == 0 && $index < 8 ? '' : 'lazy'; $itemCls = $index < 4 ? '' : 'hidden-xs'; echo << eof; + $tagIndex ++; } } ?>