Author Zi Mo
An effect of Keqiji’s homepage. Someone asked me today how I wrote it, so I rewrote another one in the evening; by the way, I’ll reorganize the layout;
You can take a look at Keqiji’s homepage first. The effect: http://shanghai.kijiji.cn
I tried not to use the position:absolute method; but it was too difficult to write; later I still used position:absolute; but it was useless on the Keqiji site ; I really don’t know how it was written at that time;
The following is the rendering:
以下是布局部分
以下是CSS部分:CSS还是没有优化的;
以下为JS部分:由于javascript对于我来说太难了;所以可能这部分写的比较烂,但效果是出来了;
<script> <BR> var k = Math.floor(Math.random()*5+1); <BR> for(i=1; i <6; i++){ <BR> if( i==k){ <BR> document.getElementById("info"+i).className="sw"; <BR> document.getElementById("tag"+i).className="ha"; <BR> document.getElementById("tag"+i).getElementsByTagName("h4")[0].className="hb"; <BR> document.getElementById("tag"+i).getElementsByTagName("a")[0].className="hc"; <BR> } <BR> else{ <BR> document.getElementById("info"+i).className="hd"; <BR> } <BR> } <BR>function kijijitag(tag){ <BR> for(i=1; i <6; i++) <BR> { <BR> if (i==tag) <BR> { <BR> document.getElementById("info"+i).className="sw"; <BR> document.getElementById("tag"+i).className="ha"; <BR> document.getElementById("tag"+i).getElementsByTagName("h4")[0].className="hb"; <BR> document.getElementById("tag"+i).getElementsByTagName("a")[0].className="hc"; <BR> } <BR> else{ <BR> document.getElementById("info"+i).className="hd"; <BR> document.getElementById("tag"+i).className=""; <BR> document.getElementById("tag"+i).getElementsByTagName("h4")[0].className=""; <BR> document.getElementById("tag"+i).getElementsByTagName("a")[0].className=""; <BR> } <BR> } <BR>} <BR></script>
以下是用到的四个图:
看下效果吧!
Special instructions:
1. The CSS part is not very clear , because I feel a little dizzy while writing;
2. The five TAGs are randomly changed;
3. The JS part can be streamlined, but it must be supported by CSS;
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn