分享
 
 
 

爽!五角星菜单酷赏,网页特效

王朝html/css/js·作者佚名  2006-11-24
窄屏简体版  字體: |||超大  

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页教学网</title>

</head>

<body>

<style type="text/css">

.dot { position: absolute; width: 6; height: 6; visibility: hidden; background-color: red; font-size: 1px; cursor: pointer; cursor: hand; z-index: 100 }

.dotoff { position: absolute; width: 6; height: 6; visibility: hidden; background-color: gray; font-size: 1px; cursor:default; z-index: 100}

.dotempty { position: absolute; width: 6; height: 6; visibility: hidden; background-color: orange; font-size: 1px; cursor: pointer; cursor: hand; zindex: 100 }

.caption { position: absolute; visibility: hidden; font-family: Tahoma; color: black;

font-size: 11px; text-align: Center; cursor: default; z-index:

1 }

body { margin: 0px; background-color: white; }

a { color: silver; text-decoration: none }

p { font-size: 10px; font-family: tahoma; color: black }

</style>

<script language="JavaScript" type="text/javascript">

function lib_bwcheck(){ //Browsercheck (needed)

this.ver=navigator.appVersion

this.agent=navigator.userAgent

this.dom=document.getElementById?1:0

this.opera5=this.agent.indexOf("Opera 5")>-1

this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;

this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;

this.ie4=(document.all && !this.dom && !this.opera5)?1:0;

this.ie=this.ie4||this.ie5||this.ie6

this.mac=this.agent.indexOf("Mac")>-1

this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;

this.ns4=(document.layers && !this.dom)?1:0;

this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)

return this

}

var bw=new lib_bwcheck()

// The code of this script is in the body, the browsercheck above is not used.

</script>

<script language="javascript1.2" type="text/javascript">

<!--

// DotMenu

// provides cross-browser functionality

//======================================

function getObjectRef(name) {

if(document.getElementById) return document.getElementById(name);

else if(document.all) return document.all[name];

else return null;

}

// general functions to assist the script

//========================================

function show(name) {

var el = getObjectRef(name);

if(el) el.style.visibility = "visible";

}

function hide(name) {

var el = getObjectRef(name);

if(el) el.style.visibility = "hidden";

}

function getWidth(name) {

var el = getObjectRef(name);

return el.offsetWidth;

}

function getHeight(name) {

var el = getObjectRef(name);

return el.offsetHeight;

}

function moveMe(name,x,y) {

var el = getObjectRef(name);

if(el) { el.style.top = parseInt(y); el.style.left = parseInt(x); }

}

function moveBy(name,x,y) {

var el = getObjectRef(name);

if(el) { el.style.top = parseInt(el.style.top) + parseInt(y); el.style.left = parseInt(el.style.left) + parseInt(x); }

}

// Creates the menu objects

//==========================

var menuCount = 0;

function menuObject(name,x,y,caption, r, parent) {

if ( (!document.getElementById&&!document.all) || navigator.userAgent.indexOf("Opera")>-1) return;

document.write('<div id="divDot' + menuCount + '" class="dotempty" style="top: ' + y + '; left: ' + x + '"></div>');

document.write('<div id="divCap' + menuCount + '" class="caption" style="top: 0; left: 0">' + caption + '</div>');

this.name = name;

this.parent = parent

this.ref = "divDot" + menuCount;

this.caption = "divCap" + menuCount

if(r) this.radius = r;

else this.radius = 400;

this.subMenus = new Array();

this.state = 0;

this.moving = false;

if(this.parent) this.action = "null";

else this.action = "toggle";

if(this.parent) this.startAngle = parent.startAngle;

else this.startAngle = 0;

getObjectRef(this.ref).objRef = this.name;

this.show = function() { show(this.ref); }

this.hide = function() { hide(this.ref); }

this.moveMe = function(x,y) { if(this.parent) { x += this.parent.x(); y += this.parent.y(); } moveMe(this.ref,x,y); }

this.moveBy = function(x,y) { moveBy(this.ref,x,y); }

this.x = function() { return parseInt(getObjectRef(this.ref).style.left); }

this.y = function() { return parseInt(getObjectRef(this.ref).style.top); }

this.w = function() { return getWidth(this.ref); }

this.h = function() { return getHeight(this.ref); }

this.showCaption = function() {

moveMe(this.caption, this.x() - (getWidth(this.caption)/2) + (this.w()/2), (this.y() + this.h()));

show(this.caption);

}

this.hideCaption = function() {

hide(this.caption);

}

this.setCaption = function(c) { getObjectRef(this.caption).innerHTML = c;}

this.addItem = function(c,action,r) {

getObjectRef(this.ref).className = "dot";

if(!r) r = this.radius/2;

var sub = new menuObject(this.name + ".subMenus[" + this.subMenus.length + "]",0,0,c,r,this);

sub.parent = this;

sub.action = action;

sub.moveMe(0,0);

this.subMenus[this.subMenus.length] = sub;

return sub;

}

this.expand = function() {

if(this.subMenus.length > 0) {

var p = true;

if(this.parent) {

p = !this.parent.moving;

for(var i=0; i<this.parent.subMenus.length;i++)

p = p && ((this.parent.subMenus[i].state==0) || (this.parent.subMenus[i].state==this.parent.subMenus[i].subMenus.length)) && (this.parent.subMenus[i].moving==false);

} else var o = false;

if((!this.parent || this.parent.state == this.parent.subMenus.length) && p) {

if(this.parent) this.collapseAll(this.name);

var diff = 360 / this.subMenus.length;

for(var i=0;i<this.subMenus.length;i++){

this.subMenus[i].moveMe(0,0);

this.subMenus[i].show();

this.moving = true;

this.subMenus[i].slide(this.subMenus[i].radius * cos(degToRad((diff*i)+this.startAngle)), this.subMenus[i].radius * sin(degToRad((diff*i)+this.startAngle)), this.name + ".subMenus[" + i + "].showCaption();" + this.name + ".moving=false;" + this.name + ".state+=1;");

}

if(this.parent){

getObjectRef(this.parent.ref).style.filter = "alpha (opacity=33)";

getObjectRef(this.parent.ref).style.MozOpacity = "33%";

getObjectRef(this.parent.ref).className = "dotoff";

getObjectRef(this.parent.caption).style.filter = "alpha (opacity=33)";

getObjectRef(this.parent.caption).style.MozOpacity = "33%";

for(i=0;i<this.parent.subMenus.length;i++) {

getObjectRef(this.parent.subMenus[i].ref).style.filter = "alpha (opacity=66)";

getObjectRef(this.parent.subMenus[i].ref).style.MozOpacity = "66%";

getObjectRef(this.parent.subMenus[i].caption).style.filter = "alpha (opacity=66)";

getObjectRef(this.parent.subMenus[i].caption).style.MozOpacity = "66%";

}

if(this.parent.parent) {

for(i=0;i<this.parent.parent.subMenus.length;i++) {

getObjectRef(this.parent.parent.subMenus[i].ref).style.filter = "alpha (opacity=33)";

getObjectRef(this.parent.parent.subMenus[i].ref).style.MozOpacity = "33%";

getObjectRef(this.parent.parent.subMenus[i].ref).className = "dotoff";

getObjectRef(this.parent.parent.subMenus[i].caption).style.filter = "alpha (opacity=33)";

getObjectRef(this.parent.parent.subMenus[i].caption).style.MozOpacity = "33%";

}

getObjectRef(this.parent.parent.ref).style.MozOpacity = "33%";

getObjectRef(this.parent.parent.ref).style.MozOpacity = "33%";

getObjectRef(this.parent.parent.ref).className = "dotoff";

}

}

getObjectRef(this.ref).style.filter = "alpha (opacity=66)";

getObjectRef(this.caption).style.filter = "alpha (opacity=66)";

getObjectRef(this.ref).style.MozOpacity = "66%";

getObjectRef(this.caption).style.MozOpacity = "66%";

}

}

}

this.collapse = function() {

var p = true;

p = !this.moving;

for(var i=0; i<this.subMenus.length;i++)

p = p && (this.subMenus[i].state==0) && (this.subMenus[i].moving==false);

if(p && this.subMenus.length > 0) {

for(var i=0;i<this.subMenus.length;i++){

this.subMenus[i].hideCaption();

this.moving = true;

this.subMenus[i].slide(0, 0, this.name + ".subMenus[" + i + "].hide();" + this.name + ".moving=false;" + this.name + ".state-=1;");

}

if(this.parent){

getObjectRef(this.parent.ref).style.filter = "alpha (opacity=66)";

getObjectRef(this.parent.ref).style.MozOpacity = "66%";

if(this.parent.subMenus.length != 0)

getObjectRef(this.parent.ref).className = "dot";

else

getObjectRef(this.parent.ref).className = "dotempty";

getObjectRef(this.parent.caption).style.filter = "alpha (opacity=66)";

getObjectRef(this.parent.caption).style.MozOpacity = "66%";

for(i=0;i<this.parent.subMenus.length;i++) {

g

[1] [2] 下一页

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有