在加载页面刷新随机CSS [英] Load random CSS on page refresh

查看:196
本文介绍了在加载页面刷新随机CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道什么叫对页面刷新随机CSS文件的JavaScript的最好方法?

I was wondering whats the best way to call a random css file on page refresh with Javascript?

非常感谢

推荐答案

谢谢你的建议,并没有意识到这是可能的PHP的简单的线条,实际上发现,该方法pretty简短而亲切

Thanks for your advice, didn't realise it was possible with a simple line of php and actually found that this method was pretty short and sweet

<link href="/styles/<?php echo mt_rand(1, 5); ?>.css" rel="stylesheet" type="text/css"/>

在这里找到, http://forum.mamboserver.com/showthread.php? T = 61029

非常感谢

PS。列表除了也有pretty简单而辉煌的方式切换图像, HTTP:// WWW。 alistapart.com/articles/randomizer/

ps. A List Apart also have a pretty simple and brilliant way to switch images, http://www.alistapart.com/articles/randomizer/

这篇关于在加载页面刷新随机CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆