建站前台常用的代码

  • A+
所属分类:web相关 系统运维
输入正文标题广告代码(非移动端)

持续整理更新一些建站时使用的代码:

页面跳转代码

<script language='javascript'>document.location = '地址'</script>

音乐播放器代码

<audio width="300" height="30" style="margin:10px 5px 15px;; auto; top:55;right: 0; bottom: 10; left: 0;" controls="controls" autoplay="autoplay" name="media" src="http://7xj28j.com1.z0.glb.clouddn.com/x10908451.mp3"></audio>

图片超链接代码

<a href="链接地址" /><img src="图片地址" /></a>

图片超链接在新窗口打开代码

<A href="链接地址" target=_blank><IMG src=" 图片地址" border=0></A>
文字超链接代码

<a href="链接地址" rel="nofollow" target="_blank">文字</a>

计时器代码

<SPAN id=span_dt_dt></SPAN> <SCRIPT language=javascript> function show_date_time() { window.setTimeout("show_date_time()", 1000); BirthDay = new Date("4/18/2015 11:30:00"); today = new Date(); timeold = (today.getTime() - BirthDay.getTime()); sectimeold = timeold / 1000 secondsold = Math.floor(sectimeold); msPerDay = 24 * 60 * 60 * 1000 e_daysold = timeold / msPerDay daysold = Math.floor(e_daysold); e_hrsold = (e_daysold - daysold) * 24; hrsold = Math.floor(e_hrsold); e_minsold = (e_hrsold - hrsold) * 60; minsold = Math.floor((e_hrsold - hrsold) * 60); seconds = Math.floor((e_minsold - minsold) * 60); span_dt_dt.innerHTML = daysold + "天" + hrsold + "小时" + minsold + "分" + seconds + "秒"; } show_date_time();</SCRIPT>

title彩蛋代码:

$(function(){ var RelTitle = document.title; var hidden, visibilityChange; if (typeof document.hidden !== "undefined") { hidden = "hidden"; visibilityChange = "visibilitychange"; } else if (typeof document.mozHidden !== "undefined") { // Firefox up to v17 hidden = "mozHidden"; visibilityChange = "mozvisibilitychange"; } else if (typeof document.webkitHidden !== "undefined") { // Chrome up to v32, Android up to v4.4, Blackberry up to v10 hidden = "webkitHidden"; visibilityChange = "webkitvisibilitychange"; } function handleVisibilityChange() { if (document[hidden]) { document.title = '(●––●) Hi, BigBai'; } else { document.title = RelTitle; } } if (typeof document.addEventListener !== "undefined" || typeof document[hidden] !== "undefined") { document.addEventListener(visibilityChange, handleVisibilityChange, false); }});

wordpress更改头像源代码

function mytheme_get_avatar($avatar) { $avatar = str_replace(array("www.gravatar.com","0.gravatar.com","1.gravatar.com","2.gravatar.com"),"gravatar.duoshuo.com",$avatar); return $avatar; } add_filter( 'get_avatar', 'mytheme_get_avatar', 10, 3 );

支付宝链接钮代码

<form accept-charset="GBK" action="https://shenghuo.alipay.com/send/payment/fill.htm" method="POST" target="_blank">
<input name="optEmail" type="hidden" value="15698880400" />
<input name="payAmount" type="hidden" value="1" />
<input name="memo" type="hidden" value="有什么想对我说的" />
<input name="title" type="hidden" value="赞助博主" />
<input name="pay" src="http://7xj28j.com1.z0.glb.clouddn.com/QQ图片20150518105152.png" alt="建站前台常用的代码" type="image" value="赞助博主" />
外链播放器代码

<iframe src="http://audioplm.sinaapp.com/xiamiplayer/1114507.mp3" width="430" height="200" frameborder="0" scrolling="0"></iframe>

用js实现计算加载页面所用的时间

在页面Head部分加入初始时间

<script language=javascript>
var t1 = new Date().getTime();
</script>
在Body中添加如下代码

<SCRIPT LANGUAGE="JavaScript">
window.onload = function()
{
document.getElementById("TimeShow").innerHTML = "加载本页耗时 "+ (new Date().getTime()-t1) +" 毫秒";
}
</SCRIPT>
在需要显示的地方插入一个ID为TimeShow的标签即可

<div id="TimeShow"></div>

输入正文底部广告代码(非移动端)
输入评论上方广告代码(非移动端)

发表评论

:?::razz::sad::evil::!::smile::oops::grin::eek::shock::???::cool::lol::mad::twisted::roll::wink::idea::arrow::neutral::cry::mrgreen: