背景自动更换之每小时Change

在<head>标签之前加入如下代码:

1
2
3
4
5
<style> body{background: url(’<?php bloginfo(’template_directory’); ?>
/images/<?php $hour = (int)date("h");$hour += 8;if($hour>12)$hour-=12;echo($hour); ?>.jpg’) repeat-x fixed #FCFCFC;} </style>

不解释,只是需要准备12张图片,标号1-12,jpg格式的,放置于主题images文件夹中。

 

 

例如:

html{cursor:url("images/Eyeshot/Cursor.cur"), default;}

设置整页默认鼠标样式

a:hover{cursor:url("images/Eyeshot/Hand.cur"),pointer;}

<link rel="stylesheet" href="<?php bloginfo(’template_url’); ?>/<?php
	$hour = (int)date("H");
	$hour += 8;
	$am = "style_AM";
	$pm = "style_PM";
	$night = "style_night";
	if($hour>6 && $hour<13){
		echo $am;
	}elseif($hour>12 && $hour<20){
		echo $pm;
	}else{
		echo $night;
	}
?>.css" type="text/css" media="screen" />

您可以选择一种方式赞助本站

发表评论

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