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]
显示效果:

© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END







![表情[aixin]-红穆笔记](https://www.4s5.cn/wp-content/themes/zibll/img/smilies/aixin.gif)



暂无评论内容