一、下载activate-power-mode.zip文件(下载链接在末尾),上传到网站目录
二、代码调用
找到主题的footer.php(编辑前请备份)文件,添加以下代码即可
代码语言:javascript复制<?php if (is_single() || is_page() ) { ?>
<script src="<?php bloginfo('template_directory'); ?>/js/activate-power-mode.js "></script>
<script type="text/javascript">
if(!(/iphone|ipod|ipad|ipad|Android|nokia|blackberry|webos|webos|webmate|bada|lg|ucweb|skyfire|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|wap|mobile/i.test(navigator.userAgent.toLowerCase()))){
POWERMODE.colorful = true;
POWERMODE.shake = false;
document.body.addEventListener('input', POWERMODE);
}
</script>
三、效果图