Browse Source

img lazyload improve

master
filesite 7 months ago
parent
commit
67adb36129
  1. 7
      themes/tajian/views/site/index.php
  2. 6
      themes/tajian/views/site/myindex.php

7
themes/tajian/views/site/index.php

@ -63,14 +63,15 @@ eof; @@ -63,14 +63,15 @@ eof;
$pubDate = date('m/d', $file['fstat']['ctime']);
$imgSrc = $index < 8 ? " src=\"{$snapshot}\"" : '';
$imgAlt = $index < 8 ? " alt=\"{$title}\"" : '';
$imgSrc = $index < 4 ? " src=\"{$snapshot}\"" : '';
$imgAlt = $index < 4 ? " alt=\"{$title}\"" : '';
$imgCls = $index < 4 ? '' : 'lazy';
echo <<<eof
<div class="vl_list_main advideo-item">
<div class="video_img_vl">
<a href="{$file['shortcut']['url']}" target="_blank">
<img data-original="{$snapshot}" class="lazy"{$imgSrc}{$imgAlt}>
<img data-original="{$snapshot}" class="{$imgCls}"{$imgSrc}{$imgAlt}>
</a>
</div>
<div class="video_title_vl">

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

@ -69,9 +69,9 @@ eof; @@ -69,9 +69,9 @@ eof;
$pubDate = date('m/d', $file['fstat']['ctime']);
$imgSrc = $tagIndex == 0 && $index < 8 ? " src=\"{$snapshot}\"" : '';
$imgAlt = $tagIndex == 0 && $index < 8 ? " alt=\"{$title}\"" : '';
$imgCls = $tagIndex == 0 && $index < 8 ? '' : 'lazy';
$imgSrc = $tagIndex == 0 && $index < 4 ? " src=\"{$snapshot}\"" : '';
$imgAlt = $tagIndex == 0 && $index < 4 ? " alt=\"{$title}\"" : '';
$imgCls = $tagIndex == 0 && $index < 4 ? '' : 'lazy';
$itemCls = $index < 4 ? '' : 'hidden-xs';
echo <<<eof

Loading…
Cancel
Save