Browse Source

improve user index image load

master
filesite 10 months ago
parent
commit
abc855e633
  1. 8
      themes/tajian/views/site/myindex.php

8
themes/tajian/views/site/myindex.php

@ -39,6 +39,7 @@ eof;
$videoExts = array('url'); $videoExts = array('url');
if (!empty($viewData['tags'])) { //显示tags分类 if (!empty($viewData['tags'])) { //显示tags分类
$tagIndex = 0;
foreach($viewData['tags'] as $id => $item) { foreach($viewData['tags'] as $id => $item) {
//输出分类名称 //输出分类名称
@ -68,9 +69,9 @@ eof;
$pubDate = date('m/d', $file['fstat']['ctime']); $pubDate = date('m/d', $file['fstat']['ctime']);
$imgSrc = $index < 8 ? " src=\"{$snapshot}\"" : ''; $imgSrc = $tagIndex == 0 && $index < 8 ? " src=\"{$snapshot}\"" : '';
$imgAlt = $index < 8 ? " alt=\"{$title}\"" : ''; $imgAlt = $tagIndex == 0 && $index < 8 ? " alt=\"{$title}\"" : '';
$imgCls = $index < 8 ? '' : 'lazy'; $imgCls = $tagIndex == 0 && $index < 8 ? '' : 'lazy';
$itemCls = $index < 4 ? '' : 'hidden-xs'; $itemCls = $index < 4 ? '' : 'hidden-xs';
echo <<<eof echo <<<eof
@ -95,6 +96,7 @@ eof;
</div> </div>
eof; eof;
$tagIndex ++;
} }
} }
?> ?>

Loading…
Cancel
Save