• 文字广告位
  • 文字广告位
  • 文字广告位
您现在的位置: 站长手册 >> 特效代码 >> 导航类 >> 正文
站内搜索
Google
[图文]按钮控制旋转的3D导航
        ★★★   

按钮控制旋转的3D导航

雅虎收藏夹 百度收藏 Google书签 Yahoo书签 新浪ViVi 搜狐网摘 365Key网摘 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 Del.icio.us digg reddit spurl BlinkList blogmarks
人气: 来源:本站原创 作者:佚名 所属栏目:导航类 [切换到繁體中文]
介绍:旋转3D菜单,通过按钮进行前后选择,内容和链接可以自己定制,酷!

演示:

[Ctrl+A全选 提示:你可先修改部分代码,再按运行]

下面教你如何应用此特效: 
 --------------------------------------------------------------------------------------
  需要在<body 这里>加入的代码:
 --------------------------------------------------------------------------------------
以下代码加到<head>…</head>中
以下代码加到<body>…</body>中
<script type="text/javascript">
<!--
eye={p:0,x:0,y:0,w:0,h:0,r:0,v:0,s:0,isVertical:0,a1:0,a2:0,a3:0,color:'#ffffff',colorover:'#ffffff',backgroundcolor:'#0099ff',backgroundcolorover:'#000000',bordercolor:'#000000',fontsize:12,fontfamily:'Arial',pas:0,spinmenu:function(){this.p=this.r/this.s;this.a1=this.a2=this.isVertical?0:Math.PI/2},spinmenuitem:function(a7,a6,a5){a4=" onclick='window.open(\""+a6+"\""+(a5?(",\""+a5+"\""):",\"_self\"")+")'";document.write("<div id='spinmenu"+this.a3+"' style='cursor:pointer;cursor:expression(\"hand\");position:absolute;width:"+this.w+"px;left:"+this.h+"px;"+"background-color:"+this.backgroundcolor+";color:"+this.color+";border:1px solid "+this.bordercolor+";font:normal "+this.fontsize+"px "+this.fontfamily+";text-align:center;cursor:default;z-Index:1000;' onmouseover='this.style.color=\""+this.colorover+"\";this.style.backgroundColor=\""+this.backgroundcolorover+"\"'"+ "onmouseout='this.style.color=\""+this.color+"\";this.style.backgroundColor=\""+this.backgroundcolor+"\"'"+a4+">"+a7+"</div>");this.a3++},muta:function(){a8=document.getElementById("controale");for(i=0;i<this.a3;i++){a9=document.getElementById("spinmenu"+i+"");a9s=a9.style;if(this.isVertical){xi=parseInt(this.r*Math.cos(this.a1+i*this.pas))/this.s;yi=parseInt(this.r*Math.sin(this.a1+i*this.pas));a10=(this.p+xi)/(2*this.p);a11=this.fontsize*(this.p+xi)/(2*this.p)+2;a12=parseInt(100*(this.p+xi)/(2*this.p))}else{xi=parseInt(this.r*Math.cos(this.a1+i*this.pas));yi=parseInt(this.r*Math.sin(this.a1+i*this.pas))/this.s;a10=(this.p+yi)/(2*this.p);a11=this.fontsize*(this.p+yi)/(2*this.p)+2;a12=parseInt(100*(this.p+yi)/(2*this.p))};a13=(this.w-20)*a10+20;a14=(this.h-20)*a10+10;a9s.top=(yi+this.y-a14/2)+"px";a9s.left=(xi+this.x-a13/2)+"px";a9s.width=a13+"px";a9s.fontSize=a11+"px";a9s.zIndex=a12};a8.style.top=this.y+(this.isVertical?this.r:this.p)+this.h/2+6;a8.style.left=this.x-a8.offsetWidth/2;if(this.a1!=this.a2){this.a1=(this.a1>this.a2)?(this.a1-this.pas/this.v):(this.a1+this.pas/this.v);if(Math.abs(this.a1-this.a2)<this.pas/this.v)
this.a1=this.a2;setTimeout("eye.muta()",10)}},spinmenuclose:function(){this.pas=2*Math.PI/this.a3;document.write('<div id="controale" style="position:absolute"><button type="" onclick="eye.a2+=eye.pas;eye.muta()" onfocus="this.blur()"><<</button> <button type="" onclick="eye.a2-=eye.pas;eye.muta()" onfocus="this.blur()">>></button></div>');eye.muta()}};

function getposOffset(what, offsettype){var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;var parentEl=what.offsetParent;while (parentEl!=null){totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft :totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}return totaloffset;

//-->
</script>

<script type="text/javascript">
<!--
eye.isVertical = 0; //if it's vertical or horizontal [0|1]
eye.x = 400; // x offset from point of insertion on page
eye.y = 70; // y offset from point of insertion on page
eye.w = 150; // item's width
eye.h = 30; // height
eye.r = 100; // menu's radius
eye.v = 20; // velocity
eye.s = 8; // scale in space (for 3D effect)
eye.color = '#ffffff'; // normal text color
eye.colorover = '#ffffff'; // mouseover text color
eye.backgroundcolor = '#0099ff'; // normal background color 
eye.backgroundcolorover = '#990000'; // mouseover background color
eye.bordercolor = '#000000'; //border color
eye.fontsize = 12; // font size
eye.fontfamily = 'Arial'; //font family
if (document.getElementById){
document.write('<div id="spinanchor" style="height:'+eval(eye.h+20)+'"></div>')
eye.anchor=document.getElementById('spinanchor')
eye.spinmenu();
eye.x+=getposOffset(eye.anchor, "left") //relatively position it
eye.y+=getposOffset(eye.anchor, "top")  //relatively position it

//menuitem:   eye.spinmenuitem(text, link, target)
eye.spinmenuitem("站长手册","http://www.zzsc.org");
eye.spinmenuitem("软件教程","http://www.zzsc.org/ruanjian/");
eye.spinmenuitem("网页语言","http://www.zzsc.org/yuyan/");
eye.spinmenuitem("特效代码","http://www.zzsc.org/texiao/");
eye.spinmenuitem("经验技巧","http://www.zzsc.org/jiqiao/");
eye.spinmenuitem("酷站欣赏","http://www.zzsc.org/kuzhan/");
eye.spinmenuclose();
}
//-->
</script>

网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
姓 名: *(必填项) ·注册用户·
Email: QQ号:
评 分: 1分 2分 3分 4分 5分
  • 您可以发表评论支持你喜欢的文章。
  • 请遵守《互联网电子公告服务管理规定》
  • 请遵守中华人民共和国各项有关法律法规。
  • 严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
  • 评论人需对自己在使用评论过程中的行为承担法律责任。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表个人观点,与本网站立场无关。
站内特效搜索
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | | 京ICP备 05004866号 |
版权所有 2007-2008 站长手册 WWW.ZZSC.ORG 业务联系 zzsc.org#gmail.com