1.css代碼:
.newpage::after {
content: "新"; /* 顯示的文字 */
display: inline-block;
color: #ff0000;
font-weight: bold;
font-size: 14px;
margin-left: 8px;
animation: gentleJump 1s ease-in-out infinite;
}
@keyframes gentleJump {
0% { transform: translateY(0); }
50% { transform: translateY(-3px); }
100% { transform: translateY(0); }
}
2.php代碼,判斷輸出class屬性值
<?php if (time() - intval($bqr['newstime']) <= 259200){echo 'newpage';}?>
3.完整的靈動標籤調用代碼。
[e:loop={1,8,0,0}]
<li>
<a class="<?php if (time() - intval($bqr['newstime']) <= 259200){echo 'newpage';}?>" href="<?=$bqsr['titleurl']?>" title="$bqr['title']"><?=esub($bqr['title'],15,"...")?></a>
<span class="carousel-date"><?=date("Y-m-d",$bqr[newstime])?></span>
</li>
[/e:loop]
顯示效果:
