网站地图    收藏   

主页 > 前端 > javascript >

js网站淡入淡出核心思想

来源:未知    时间:2014-09-27 09:48 作者:xbdadmin 阅读:

[导读] 上面是图片下面是源码 script type=text/javascript window.onload=function() { var oBox=document.getElementById(box); var aLi=document.getElementsByTagName(li); var i=0; for(i=0;iaLi.length;i++) { var oP=aLi[i].getElementsByTagName(p...

 
上面是图片下面是源码

<script type="text/javascript">
window.onload=function()
{
var oBox=document.getElementById("box");
var aLi=document.getElementsByTagName('li');
var i=0;
for(i=0;i<aLi.length;i++)
{
var oP=aLi[i].getElementsByTagName('p')[0];
oP.iAlpha=0;
oP.time=null;
aLi[i].onmouseover=function()
{
var oP=this.getElementsByTagName('p')[0];
oP.time?clearInterval(oP.time):"";
oP.style.opacity=1;
oP.style.filter="alpha(opacity=100)";
oP.iAlpha=100;
}
aLi[i].onmouseout=function(){
starmove(this.getElementsByTagName('p')[0]);
};
}
};
function starmove(obj)
{
obj.time?clearInterval(obj.time):"";
obj.time=setInterval(function(){domove(obj);},14);
}
function domove(obj)
{
var iSpeed=5;
if(obj.iAlpha<=iSpeed)
{
clearInterval(obj.time);
obj.iAlpha=0;
obj.time=null;
}
else
{
obj.iAlpha-=iSpeed;
}
obj.style.opacity=obj.iAlpha/100;
obj.style.filter="alpha(opacity="+obj.iAlpha+")";
}
</script>
 


<body>
<div id="box">
<div class="left">
<h2><strong>最新消息</strong><a href="http://www.miaov.com">more</a></h2>
<ul>
<li>
<p></p>
<div>
<a target="_blank" href="http://bbs.miaov.com/viewthread.php?tid=126&amp;extra=page%3D1">课程常见问题合集</a>
<span>2011-03-29</span>
</div>
</li>
<li>
<p></p>
<div>
<a target="_blank" href="http://bbs.miaov.com/viewthread.php?tid=78&amp;extra=page%3D1">妙味课堂JS课程结课标准</a>
<span>2011-03-27</span>
</div>
</li>
<li>
<p></p>
<div>
<a target="_blank" href="http://bbs.miaov.com/forumdisplay.php?fid=4">网页特效大集合(每天更新)</a>
<span>2011-03-22</span>
</div>
</li>
<li>
<p></p>
<div>
<a target="_blank" href="http://bbs.miaov.com/viewthread.php?tid=30&amp;extra=page%3D1">妙味课堂上课地点</a>
<span>2011-03-19</span>
</div>
</li>
<li>
<p></p>
<div>
<a target="_blank" href="http://bbs.miaov.com/viewthread.php?tid=50&amp;extra=">CSS课程最新开班时间</a>
<span>2011-03-19</span>
</div>
</li>
<li>
<p></p>
<div>
<a target="_blank" href="http://bbs.miaov.com/viewthread.php?tid=49&amp;extra=">JavaScript课程最新开班时间</a>
<span>2011-03-19</span>
</div>
</li>
<li>
<p></p>
<div>
<a target="_blank" href="http://www.miaov.com/course_detail_3.html.php#course_details">妙味推出零基础网页制作课程</a>
<span>2011-03-19</span>
</div>
</li>
</ul>
</div>
<div class="right">
<h2><strong>茶馆新鲜事</strong><a href="http://bbs.miaov.com">more</a></h2>
<ul>       
<li>
<p></p>
<div>
<a href="http://bbs.miaov.com/viewthread.php?tid=29&amp;extra=page%3D1" target="_blank">JavaScript实现的3D球面标签云效果</a>
<span>2011-03-29</span>
</div>
</li>
<li>
<p></p>
<div>
<a href="http://bbs.miaov.com/viewthread.php?tid=104&amp;extra=page%3D1" target="_blank">周六JavaScript聚会活动现场记录</a>
<span>2011-03-27</span>
</div>
</li>
<li>
<p></p>
<div>
<a href="http://bbs.miaov.com/viewthread.php?tid=43&amp;extra=page%3D1" target="_blank">阿里前端面试题</a>
<span>2011-03-19</span>
</div>
</li>
<li>
<p></p>
<div>
<a href="http://bbs.miaov.com/viewthread.php?tid=36&amp;extra=page%3D1" target="_blank">浅析google地图前端实现原理(一)</a>
<span>2011-03-19</span>
</div>
</li>
<li>
<p></p>
<div>
<a href="http://bbs.miaov.com/viewthread.php?tid=46&amp;extra=page%3D1" target="_blank">Windows计算器(简易版)作业练习——妙味课堂</a>
<span>2011-03-19</span>
</div>
</li>
<li>
<p></p>
<div>
<a href="http://bbs.miaov.com/viewthread.php?tid=45&amp;extra=page%3D1" target="_blank">妙味课堂——手风琴缓动效果</a>
<span>2011-03-19</span>
</div>
</li>
<li>
<p></p>
<div>
<a href="http://bbs.miaov.com/viewthread.php?tid=29&amp;extra=page%3D1" target="_blank">JavaScript实现的3D球面标签云效果</a>
<span>2011-03-19</span>
</div>
</li>
</ul>
</div>
</div>
<dl>
                    
                  
 
</body>

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论