自定义评论框背景图
Handsome自行后台添加,其他主题通过css实现
代码添加到自定义css中
#comment-textarea {background-image:url(https://www.ysazw.cn/ysimg/plk.gif );
background-size:contain;
background-repeat:no-repeat;
background-position:right bottom;
transition:all 0.25s ease-in-out 0s;
}
textarea#comment-textarea:focus{
background-position-y:120px;
transition:all 0.25s ease-in-out 0s;
}
简单js实现倒计时
代码复制到footer.php
合适位置
<script type="text/javascript">
// JavaScript Document
function ShowTimes(){
var AfterTime= new Date("2021/02/12 00:00:00");//新年
LeaveTime = AfterTime - new Date();
LeaveDays=Math.floor(LeaveTime/(1000*60*60*24));//天
LeaveHours=Math.floor(LeaveTime/(1000*60*60)%24);//时
LeaveMinutes=Math.floor(LeaveTime/(1000*60)%60);//分
LeaveSeconds=Math.floor(LeaveTime/1000%60);//秒
var c=new Date();
var q=c.getMilliseconds();
if(q<10)//由于毫秒为一位数时仅仅占一个字符位置。会让毫秒二字变动位置
{
q="00"+c.getMilliseconds();
}
if(q>=10 && q<100)//由于毫秒为两位数时仅仅占两个字符位置,会让毫秒二字变动位置
{
q="0"+c.getMilliseconds();
}
hxtime.innerHTML="离2021新年仅剩:"+LeaveDays+"天"+LeaveHours+"时"+LeaveMinutes+"分"+LeaveSeconds+"秒"+q+"毫秒";
}
setInterval(ShowTimes,10);
</script>
<h3><span class="f30" id="hxtime">离仅剩:-90天-23时-33分-60秒523毫秒</span></h3>
One comment