闪闪发光的星星背景 [英] Glittering stars background
本文介绍了闪闪发光的星星背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请有人帮我这个。
如何为我的背景制作闪闪发光的星星效果?
请帮助,TIA
M
Hi,
can anybody help me with this one please.
How can I make a glittering stars effect for my background?
Please help, TIA
M
推荐答案
您可能正在寻找这个Java小程序:
http://javaboutique.internet.com/JMakerStars/
或
http://javaboutique.internet.com/WBStarfield/
" Miha Kovac" < MI ******* @ yahoo.com> schrieb im Newsbeitrag
新闻:WY ******************** @ news.siol.net ...
"Miha Kovac" <mi*******@yahoo.com> schrieb im Newsbeitrag
news:WY********************@news.siol.net...
请有人帮我这个。
如何为我的背景制作一个闪闪发光的星星效果?
请帮忙,TIA
M
Hi,
can anybody help me with this one please.
How can I make a glittering stars effect for my background?
Please help, TIA
M
制作动画背景gif。
- -
Markus
Make an animated background gif.
--
Markus
Miha Kovac说:
Miha Kovac said:
>请有人帮我这个。
如何为我的背景制作闪闪发光的星星效果?
这里是一个相当简单的Javascript实现。
在实践中,我可能想修改脚本到
自动放置指定(或随机)数量的星星,
会调整时间,当然会更好用
图形:
< html>
< head>
< script type =" text / javascript">
var starList = new Array();
var starState = new Array(3);
for(var i = 0; i< starState.length; i ++){
starState [i] =新图片(20,20);
starState [i] .src =" http://www.azphx.com/tmp/ star" + i +" .gif";
}
function twinkle(n){
starList [n] .src = starState [Math.floor(Math.random()* 3)]。src;
setTimeout(" twinkle(" + n +")",Math.floor(Math.random( )* 1000 + 500));
}
函数init(){
var i = 0;
var star;
var id =&qu ot; star" +((i< 10)?" 0":"")+ i;
while(star = document.getElementById(id)){
starList [i] = star;
setTimeout(" twinkle(" + i +")",Math.floor(Math.random()* 1000 + 500)) ;
i ++;
id =" star" +((i< 10)?" 0":"")+ i;
}
}
< / script>
< / head>
< body onload =" init()">
< div style =" position:absolute; top:10px; left:10px"< img id =" star00" SRC =" star0.gif">< / DIV>
< div style =" position:absolute; top:10px; left:100px"< img id =" star01" SRC =" star0.gif">< / DIV>
< div style =" position:absolute; top:100px; left:100px"< img id =" star02" SRC =" star0.gif">< / DIV>
< div style =" position:absolute; top:30px; left:50px"< img id =" star03" SRC =" star0.gif">< / DIV>
< div style =" position:absolute; top:60px; left:40px"< img id =" star04" src =" star0.gif">< / div>
Hi,
can anybody help me with this one please.
How can I make a glittering stars effect for my background?
Here''s a fairly simple-minded Javascript implementation.
In practice, I would probably want to modify the script to
automatically place a specified (or random) number of stars,
would tweak the timing, and, of course, would use better
graphics:
<html>
<head>
<script type="text/javascript">
var starList=new Array();
var starState=new Array(3);
for(var i=0;i<starState.length;i++){
starState[i]=new Image(20,20);
starState[i].src="http://www.azphx.com/tmp/star"+i+".gif";
}
function twinkle(n){
starList[n].src=starState[Math.floor(Math.random()*3)].src;
setTimeout("twinkle("+n+")",Math.floor(Math.random ()*1000+500));
}
function init(){
var i=0;
var star;
var id="star"+((i<10)?"0":"")+i;
while(star=document.getElementById(id)){
starList[i]=star;
setTimeout("twinkle("+i+")",Math.floor(Math.random ()*1000+500));
i++;
id="star"+((i<10)?"0":"")+i;
}
}
</script>
</head>
<body onload="init()">
<div style="position:absolute;top:10px;left:10px"<img id="star00" src="star0.gif"></div> <div style="position:absolute;top:10px;left:100px"<img id="star01" src="star0.gif"></div> <div style="position:absolute;top:100px;left:100px"<img id="star02" src="star0.gif"></div> <div style="position:absolute;top:30px;left:50px"<img id="star03" src="star0.gif"></div> <div style="position:absolute;top:60px;left:40px"<img id="star04" src="star0.gif"></div>
< / body>
< / html>
</body>
</html>
这篇关于闪闪发光的星星背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文