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

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

问题描述

我想知道什么是使用Javascript刷新页面时调用随机css文件的最佳方法。



非常感谢

$ b $

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

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



很多感谢



ps。 List Apart也有一个非常简单和聪明的方式来切换图片, http://www.alistapart。 com / articles / randomizer /


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

Many thanks

解决方案

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"/>

Found it here, http://forum.mamboserver.com/showthread.php?t=61029

Many thanks

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天全站免登陆