我怎么能旋转的文本行的每个页面刷新? [英] How can I rotate a line of text each page refresh?
问题描述
现在,reddit的下跌。每次你去它的时候,它会显示一个标志和它下面的一个有趣的消息。每次刷新页面,它会显示一个新的消息。
Right now, Reddit is down. Every time you go to it, it displays a logo and below it a funny message. Every time you refresh the page it displays a new message.
我怎么可以写一些简单的旋转〜〜(不是随机的)文本的页面上每行刷新?
How could I write something simple that ~rotates~ (not random) a line of text on the page every refresh?
我使用ASP.NET MVC,但如果有一个JavaScript解决这个问题是没关系。
I'm using ASP.NET MVC but if there is a JavaScript solution to this problem that is fine too.
推荐答案
这是你怎么能写:
对于JavaScript,只要使用张贴安迪白色的链接,并替换调用 Math.floor(7 *的Math.random())
来确定get / set的cookie值。你可以找到现成利用javascript函数来读取和写入谷歌饼干。
For javascript, simply use the link posted by Andy White and replace the call to Math.floor(7*Math.random())
to a get/set cookie value. You can find ready-to-use javascript functions to read and write cookies on google.
有关asp.net MVC中,code不会相差很多,你只需要寻找功能,轻松操作饼干,因为它们是内置。
For asp.net mvc, the code won't differ a lot, you just have to look for functions to easily manipulate cookies as they are built-in.
这篇关于我怎么能旋转的文本行的每个页面刷新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!