首页
Portal
推荐
分享交流
应用演示
应用中心
登录
注册
DIV+CSS+JS的菜单, 广告特效代码
关注
私信
水煮鱼
问答
Discuz!
WordPress
资源分享
主题演示
插件演示
威兔网
»
分享
发新帖
DIV+CSS+JS的菜单, 广告特效代码
来自:
分享
作者:
水煮鱼
时间: 2010-11-12 11:15
查看: 4318
回复: 0
今日偶然发现一段DIV+CSS+JS的特效代码, 用来做菜单, 做广告做图片展示均可! 很炫!
截图:
源代码:
<html>
<head>
<style type="text/css">
body {cursor:hand; margin:0; padding:0; position:absolute; overflow:hidden; left:0; top:0; width:100%; height:100%;}
.link {position:absolute;left:0;width:100%;height:0;background:#000;overflow:hidden;visibility:hidden;}
.title {position:relative;cursor:pointer;background:#FF6600;width:100%;color:#fff;font-family:trebuchet MS;verdana;font-size:11px;left:2;height:15;overflow:hidden;}
.title_o {position:relative;cursor:pointer;background:#fff;width:100%;color:#000;font-family:trebuchet MS;verdana;font-size:11px;left:2;height:15;overflow:hidden;}
.text {position:relative;text-align:justify;margin:10px;font-family:trebuchet MS;verdana;font-size:11px;color:#FFF;overflow:hidden;height:90%}
.fernando { font-family: "Trebuchet MS", Geneva, Arial, Helvetica, san-serif; font-size: 16px; font-weight: bolder}
.mafra { }
</style>
<script type="text/javascript"><!--
var object = new Array();
function Slide(N,oCont){
this.N = N;
this.S = 1.1;
this.object = new Array();
this.CObj = function (parent,N){
this.parent = parent;
this.N = N;
this.obj = parent.frm[N];
this.tit = this.obj.firstChild;
this.div = this.obj.getElementsByTagName("div")[1];
this.div.style.visibility = "hidden";
this.y0 = N * 18;
this.Y1 = this.y0;
this.obj.style.top = this.y0;
this.obj.style.height = parent.H - (parent.NF-1) * 18 - 3;
this.obj.style.visibility = "visible";
this.obj.parent = this;
this.run = false;
this.move = function(){
with(this){
dy = (y1-y0)/parent.S;
if(Math.abs(dy)>.1){
y0+=dy;
obj.style.top = Math.round(y0);
setTimeout("object["+parent.N+"].object["+N+"].move();", 16);
} else {
run = false;
if(dy>0)div.style.visibility="hidden";
else if(N>0)parent.object[N-1].div.style.visibility="hidden";
}
}
}
this.obj.onmouseover = function(){
with(this.parent){
if(!run){
run = true;
div.style.visibility="visible";
for(i=0;i<parent.NF;i++)parent.object[i].tit.className = "title";
tit.className = "title_o";
for(i=0;i<=N;i++){
parent.object[i].y1 = i*18;
parent.object[i].move();
}
for(i=N+1;i<parent.NF;i++){
parent.object[i].y1 = parent.H-(parent.NF-i)*18;
parent.object[i].move();
}
}
}
}
}
this.frm = document.getElementById(oCont);
this.H = parseInt(this.frm.style.height);
this.frm = this.frm.getElementsByTagName("span");
this.NF = this.frm.length;
for(i=0;i<this.NF;i++) this.object[i] = new this.CObj(this, i);
this.object[0].obj.onmouseover();
this.S = 10;
}
onload = function() {
object[0] = new Slide(0, "frames");
}
//-->
</script>
</head>
<body bgcolor="#333333">
<div style="position:absolute;left:50%;top:50%">
<div id="frames" style="position:absolute;width:200;height:340;left:-100;top:-180;overflow:hidden">
<span class="link">
<div class="title"></div>
<div style="position:relative;text-align:center;margin:0px;font-family:trebuchet MS; verdana;font-size:29px;font-weight:bold;color:#FFF;overflow:hidden;height:120%">
<a href="http://www.mafra.fot.br/photos/alimentos.htm" target="_self" onFocus="if(this.blur)this.blur()"><img src="http://www.mafra.fot.br/photos/images/img_logo_home.gif" width="191" height="189" border="0"></a>
</div>
</span> <span class="link">
<div class="title"><b> alimentos /<i> food</i></b></div>
<div class="text"> <a href="http://www.mafra.fot.br/photos/alimentos.htm" target="_self" onFocus="if(this.blur)this.blur()"><img src="http://www.mafra.fot.br/photos/images/img_home-01.jpg" width="183" height="174" border="0"></a>
</div>
</span> <span class="link">
<div class="title"><b> bebidas /<i> drinks</i></b></div>
<div class="text"> <a href="http://www.mafra.fot.br/photos/bebidas.htm" target="_self" onFocus="if(this.blur)this.blur()"><img src="http://www.mafra.fot.br/photos/images/img_home-02.jpg" width="183" height="174" border="0"></a>
</div>
</span> <span class="link">
<div class="title"><b> joias /<i> jewels</i></b></div>
<div class="text"> <a href="http://www.mafra.fot.br/photos/joias.htm" target="_self" onFocus="if(this.blur)this.blur()"><img src="http://www.mafra.fot.br/photos/images/img_home-03.jpg" width="183" height="174" border="0"></a>
</div>
</span> <span class="link">
<div class="title"><b> natureza /<i> nature</i></b></div>
<div class="text"> <a href="http://www.mafra.fot.br/photos/natureza.htm" target="_self" onFocus="if(this.blur)this.blur()"><img src="http://www.mafra.fot.br/photos/images/img_home-04.jpg" width="183" height="174" border="0"></a>
</div>
</span> <span class="link">
<div class="title"><b> gente /<i> people</i></b></div>
<div class="text"> <a href="http://www.mafra.fot.br/photos/pessoas.htm" target="_self" onFocus="if(this.blur)this.blur()"><img src="http://www.mafra.fot.br/photos/images/img_home-05.jpg" width="183" height="174" border="0"></a>
</div>
</span> <span class="link">
<div class="title"><b> produtos /<i> products</i></b></div>
<div class="text"> <a href="http://www.mafra.fot.br/photos/produtos.htm" target="_self" onFocus="if(this.blur)this.blur()"><img src="http://www.mafra.fot.br/photos/images/img_home-06.jpg" width="183" height="174" border="0"></a>
</div>
</span> <span class="link">
<div class="title"><b> contato /<i> contact</i></b></div>
<div style="position:relative;text-align:center;margin:0px;font-family:verdana;font-size:32px;font-weight:bold;color:#FFF;overflow:hidden;height:90%">
<a href="mailto:mafra@mafra.fot.br?Subject=Contato - Contact"><img src="http://www.mafra.fot.br/photos/images/img_assina_home.gif" width="191" height="189" border="0"></a>
</div>
</span></div>
</div>
<div style="position:relative; text-align:center; margin:0px; font-family:verdana; font-size:9px; font-weight:normal; color:#999999; overflow:hidden; height:131px; left: 414px; top: 474px; width: 172px;">
</div>
<script type="text/javascript">
_uacct = "UA-1182901-1";
urchinTracker();
</script>
</body>
</html>
复制代码
回复
快速回复
您需要登录后才可以回帖
登录
|
注册
发表回复
Smilies
Code
高级模式
水煮鱼
帖子 567 篇
关注
私信
下载虚拟机软件 VMware Workstation Pro
Github 客户端软件
延长 Windows 更新暂停周期
解决千千静听歌词服务器失效的问题
热门主题
更多
1
ECMall仿京东商城风格免费发布
2
太有才了!让人称绝的404错误页面
3
动画效果打开与关闭图层, 效果十分流畅
4
超炫的图片展示代码
5
Lost World's Fairs
6
HTML特殊字符编码大全
7
heiko waechter
8
FreeWebHostingArea美国高速PHP免费空间
9
Synthview
扫码分享给朋友
© 2006-2024
V2STUDIO
QQ
微信
快速回复
返回顶部