├── README.md ├── Algorithm.cpp ├── image ├── 0.png ├── 1.jpg ├── 10.jpg ├── 11.jpg ├── 12.jpg ├── 13.jpg ├── 14.jpg ├── 15.jpg ├── 16.jpg ├── 17.jpg ├── 18.jpg ├── 19.jpg ├── 2.jpg ├── 20.jpg ├── 21.jpg ├── 22.jpg ├── 23.jpg ├── 24.jpg ├── 25.jpg ├── 26.jpg ├── 27.jpg ├── 28.jpg ├── 29.jpg ├── 3.jpg ├── 30.jpg ├── 31.jpg ├── 32.jpg ├── 33.jpg ├── 34.jpg ├── 35.jpg ├── 36.jpg ├── 37.jpg ├── 38.jpg ├── 39.jpg ├── 4.jpg ├── 40.jpg ├── 41.jpg ├── 42.jpg ├── 43.jpg ├── 44.jpg ├── 45.jpg ├── 46.jpg ├── 47.jpg ├── 48.jpg ├── 49.jpg ├── 5.jpg ├── 50.jpg ├── 51.jpg ├── 52.jpg ├── 53.jpg ├── 54.jpg ├── 6.jpg ├── 7.jpg ├── 8.jpg ├── 9.jpg ├── 10-no.jpg ├── 14-1.jpg ├── 24-1.jpg ├── 24-2.jpg ├── 25-1.jpg ├── bg-1.psd ├── leida1.jpg ├── leida2-1.jpg ├── leida2.jpg ├── leida2.png ├── leida3.jpg ├── logo1_3.png ├── 图片编号对应名字.txt └── logo1_3 - 副本.png ├── font └── monaco.ttf ├── script ├── zain-window-user.js ├── index.js └── zain-window-basic.js ├── style ├── zain-window-basic.css ├── zain-window-user.css └── index.css └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # LeidaMovie 2 | LeidaMovie 3 | # Zain Chen 4 | -------------------------------------------------------------------------------- /Algorithm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/Algorithm.cpp -------------------------------------------------------------------------------- /image/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/0.png -------------------------------------------------------------------------------- /image/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/1.jpg -------------------------------------------------------------------------------- /image/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/10.jpg -------------------------------------------------------------------------------- /image/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/11.jpg -------------------------------------------------------------------------------- /image/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/12.jpg -------------------------------------------------------------------------------- /image/13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/13.jpg -------------------------------------------------------------------------------- /image/14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/14.jpg -------------------------------------------------------------------------------- /image/15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/15.jpg -------------------------------------------------------------------------------- /image/16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/16.jpg -------------------------------------------------------------------------------- /image/17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/17.jpg -------------------------------------------------------------------------------- /image/18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/18.jpg -------------------------------------------------------------------------------- /image/19.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/19.jpg -------------------------------------------------------------------------------- /image/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/2.jpg -------------------------------------------------------------------------------- /image/20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/20.jpg -------------------------------------------------------------------------------- /image/21.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/21.jpg -------------------------------------------------------------------------------- /image/22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/22.jpg -------------------------------------------------------------------------------- /image/23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/23.jpg -------------------------------------------------------------------------------- /image/24.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/24.jpg -------------------------------------------------------------------------------- /image/25.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/25.jpg -------------------------------------------------------------------------------- /image/26.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/26.jpg -------------------------------------------------------------------------------- /image/27.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/27.jpg -------------------------------------------------------------------------------- /image/28.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/28.jpg -------------------------------------------------------------------------------- /image/29.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/29.jpg -------------------------------------------------------------------------------- /image/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/3.jpg -------------------------------------------------------------------------------- /image/30.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/30.jpg -------------------------------------------------------------------------------- /image/31.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/31.jpg -------------------------------------------------------------------------------- /image/32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/32.jpg -------------------------------------------------------------------------------- /image/33.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/33.jpg -------------------------------------------------------------------------------- /image/34.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/34.jpg -------------------------------------------------------------------------------- /image/35.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/35.jpg -------------------------------------------------------------------------------- /image/36.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/36.jpg -------------------------------------------------------------------------------- /image/37.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/37.jpg -------------------------------------------------------------------------------- /image/38.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/38.jpg -------------------------------------------------------------------------------- /image/39.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/39.jpg -------------------------------------------------------------------------------- /image/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/4.jpg -------------------------------------------------------------------------------- /image/40.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/40.jpg -------------------------------------------------------------------------------- /image/41.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/41.jpg -------------------------------------------------------------------------------- /image/42.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/42.jpg -------------------------------------------------------------------------------- /image/43.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/43.jpg -------------------------------------------------------------------------------- /image/44.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/44.jpg -------------------------------------------------------------------------------- /image/45.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/45.jpg -------------------------------------------------------------------------------- /image/46.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/46.jpg -------------------------------------------------------------------------------- /image/47.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/47.jpg -------------------------------------------------------------------------------- /image/48.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/48.jpg -------------------------------------------------------------------------------- /image/49.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/49.jpg -------------------------------------------------------------------------------- /image/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/5.jpg -------------------------------------------------------------------------------- /image/50.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/50.jpg -------------------------------------------------------------------------------- /image/51.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/51.jpg -------------------------------------------------------------------------------- /image/52.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/52.jpg -------------------------------------------------------------------------------- /image/53.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/53.jpg -------------------------------------------------------------------------------- /image/54.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/54.jpg -------------------------------------------------------------------------------- /image/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/6.jpg -------------------------------------------------------------------------------- /image/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/7.jpg -------------------------------------------------------------------------------- /image/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/8.jpg -------------------------------------------------------------------------------- /image/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/9.jpg -------------------------------------------------------------------------------- /font/monaco.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/font/monaco.ttf -------------------------------------------------------------------------------- /image/10-no.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/10-no.jpg -------------------------------------------------------------------------------- /image/14-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/14-1.jpg -------------------------------------------------------------------------------- /image/24-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/24-1.jpg -------------------------------------------------------------------------------- /image/24-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/24-2.jpg -------------------------------------------------------------------------------- /image/25-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/25-1.jpg -------------------------------------------------------------------------------- /image/bg-1.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/bg-1.psd -------------------------------------------------------------------------------- /image/leida1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/leida1.jpg -------------------------------------------------------------------------------- /image/leida2-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/leida2-1.jpg -------------------------------------------------------------------------------- /image/leida2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/leida2.jpg -------------------------------------------------------------------------------- /image/leida2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/leida2.png -------------------------------------------------------------------------------- /image/leida3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/leida3.jpg -------------------------------------------------------------------------------- /image/logo1_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/logo1_3.png -------------------------------------------------------------------------------- /image/图片编号对应名字.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/图片编号对应名字.txt -------------------------------------------------------------------------------- /image/logo1_3 - 副本.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/LeidaMovie/master/image/logo1_3 - 副本.png -------------------------------------------------------------------------------- /script/zain-window-user.js: -------------------------------------------------------------------------------- 1 | var windowZain = new ZainWindow("zain"); //构造窗口对象 2 | windowZain.setWidth("90px"); //设置窗口相关属性 3 | windowZain.setHeight("150px"); 4 | windowZain.setMaxWidth("200px"); 5 | windowZain.setMaxHeight("150px"); 6 | windowZain.setMinWidth("90px"); 7 | windowZain.setMinHeight("150px"); 8 | windowZain.setTitleHeight("30px"); 9 | windowZain.setBorderWidth("5px"); 10 | windowZain.setLeft("600px"); 11 | windowZain.setTop("450px"); 12 | windowZain.showWindowInfo(); 13 | -------------------------------------------------------------------------------- /style/zain-window-basic.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | /*禁止页面选择文字*/ 5 | -moz-user-select: none; /*火狐*/ 6 | -webkit-user-select: none; /*webkit浏览器*/ 7 | -ms-user-select: none; /*IE10*/ 8 | -khtml-user-select: none; /*早期浏览器*/ 9 | user-select: none; 10 | } 11 | html,body { 12 | /*overflow: hidden;*/ 13 | width: 100%; 14 | height: 100%; 15 | /*background: #eee;*/ 16 | } 17 | zain-window,#zain-window { 18 | overflow: hidden; 19 | display: block; 20 | position: absolute; 21 | z-index: 1; 22 | box-shadow: 0 0 15px #555; 23 | } 24 | zain-window-title,#zain-window-title { 25 | display: block; 26 | position: absolute; 27 | z-index: 200; 28 | background: rgba(0,0,0,0.6); 29 | /*cursor: crosshair;*/ 30 | } 31 | zain-window-content,#zain-window-content { 32 | display: block; 33 | position: absolute; 34 | z-index: 1; 35 | background: rgba(200,200,200,0.5); 36 | } 37 | zain-window-left-top,#zain-window-left-top { 38 | display: block; 39 | position: absolute; 40 | z-index: 200; 41 | background: rgba(50,50,50,0.9); 42 | cursor: nw-resize; 43 | } 44 | zain-window-top,#zain-window-top { 45 | display: block; 46 | position: absolute; 47 | z-index: 200; 48 | background: rgba(50,50,50,0.5); 49 | cursor: n-resize; 50 | } 51 | zain-window-right-top,#zain-window-right-top { 52 | display: block; 53 | position: absolute; 54 | z-index: 200; 55 | background: rgba(50,50,50,0.9); 56 | cursor: ne-resize; 57 | } 58 | zain-window-left,#zain-window-left { 59 | display: block; 60 | position: absolute; 61 | z-index: 200; 62 | background: rgba(50,50,50,0.5); 63 | cursor: w-resize; 64 | } 65 | zain-window-right,#zain-window-right { 66 | display: block; 67 | position: absolute; 68 | z-index: 200; 69 | background: rgba(50,50,50,0.5); 70 | cursor: e-resize; 71 | } 72 | zain-window-left-bottom,#zain-window-left-bottom { 73 | display: block; 74 | position: absolute; 75 | z-index: 200; 76 | background: rgba(50,50,50,0.9); 77 | cursor: sw-resize; 78 | } 79 | zain-window-bottom,#zain-window-bottom { 80 | display: block; 81 | position: absolute; 82 | z-index: 200; 83 | background: rgba(50,50,50,0.5); 84 | cursor: s-resize; 85 | } 86 | zain-window-right-bottom,#zain-window-right-bottom { 87 | display: block; 88 | position: absolute; 89 | z-index: 200; 90 | background: rgba(50,50,50,0.9); 91 | cursor: se-resize; 92 | } -------------------------------------------------------------------------------- /style/zain-window-user.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | /*禁止页面选择文字*/ 5 | -moz-user-select: none; /*火狐*/ 6 | -webkit-user-select: none; /*webkit浏览器*/ 7 | -ms-user-select: none; /*IE10*/ 8 | -khtml-user-select: none; /*早期浏览器*/ 9 | user-select: none; 10 | } 11 | html,body { 12 | /*overflow: hidden;*/ 13 | width: 100%; 14 | height: 100%; 15 | /*background: #eee;*/ 16 | } 17 | zain-window,#zain-window { 18 | overflow: hidden; 19 | display: block; 20 | position: absolute; 21 | z-index: 500; 22 | box-shadow: 0 0 15px #555; 23 | transition: 1s; 24 | } 25 | zain-window-title,#zain-window-title { 26 | display: block; 27 | position: absolute; 28 | z-index: 200; 29 | background: rgba(0,0,0,0.6); 30 | /*cursor: crosshair;*/ 31 | } 32 | zain-window-content,#zain-window-content { 33 | display: block; 34 | position: absolute; 35 | z-index: 1; 36 | background: rgba(200,200,200,0.5); 37 | } 38 | zain-window-left-top,#zain-window-left-top { 39 | display: block; 40 | position: absolute; 41 | z-index: 200; 42 | background: rgba(50,50,50,0); 43 | cursor: nw-resize; 44 | } 45 | zain-window-top,#zain-window-top { 46 | display: block; 47 | position: absolute; 48 | z-index: 200; 49 | background: rgba(50,50,50,0); 50 | cursor: n-resize; 51 | } 52 | zain-window-right-top,#zain-window-right-top { 53 | display: block; 54 | position: absolute; 55 | z-index: 200; 56 | background: rgba(50,50,50,0); 57 | cursor: ne-resize; 58 | } 59 | zain-window-left,#zain-window-left { 60 | display: block; 61 | position: absolute; 62 | z-index: 200; 63 | background: rgba(50,50,50,0); 64 | cursor: w-resize; 65 | } 66 | zain-window-right,#zain-window-right { 67 | display: block; 68 | position: absolute; 69 | z-index: 200; 70 | background: rgba(50,50,50,0); 71 | cursor: e-resize; 72 | } 73 | zain-window-left-bottom,#zain-window-left-bottom { 74 | display: block; 75 | position: absolute; 76 | z-index: 200; 77 | background: rgba(50,50,50,0); 78 | cursor: sw-resize; 79 | } 80 | zain-window-bottom,#zain-window-bottom { 81 | display: block; 82 | position: absolute; 83 | z-index: 200; 84 | background: rgba(50,50,50,0); 85 | cursor: s-resize; 86 | } 87 | zain-window-right-bottom,#zain-window-right-bottom { 88 | display: block; 89 | position: absolute; 90 | z-index: 200; 91 | background: rgba(50,50,50,0); 92 | cursor: se-resize; 93 | } -------------------------------------------------------------------------------- /script/index.js: -------------------------------------------------------------------------------- 1 | var personNumber = 0; //准备随机分配的人数 2 | var personName = new Array("", 3 | "曾文豪", "廖元武", "吴小伟", "熊敏", "罗剑", "付建平", "罗智强", "彭昌文", "王福东", 4 | "邓琼", "谢晔玲", "曾小斌", "段聪", "康宇晨", "孔佳承", "欧阳煜", "朱佳", "陈志银", 5 | "戴新亮", "周吉海", "欧著源", "朱婷", "杨成龙", "鄢艳玲", "郭莉华", 6 | "熊志勇", "朱模健", 7 | "张君", "徐海洋", "何银坤", "邹逸凡", "吴志锋", "樊泽亮", "凌杰", "欧阳皓明", "陈涛", 8 | "李川娇", "褚后屹", "--39", "--40--", "--41--", "--42--", "--43--", "--44--", "--45--", 9 | "--46--", "--47--", "--48--", "--49--", "--50--", "--51--", "--52--", "--53--", "--54--" 10 | ); 11 | // var pn = new Array(); 12 | 13 | function Execute() { //在文档加载完成后才能够去执行,可以避免获取不到对象的情况,同时可以避免定义全局变量和函数 14 | selectSeat(); //挑选座位和人员(只有选中了的座位才给排序) 15 | startButton(); //开始分配座位按钮 16 | shiftButton(); //背景与位置选择框切换功能 17 | moveLi(); //鼠标经过li效果 18 | allSelect(); //座位全选函数 19 | } 20 | 21 | function selectSeat() { //挑选座位和人员(只有选中了的座位才给排序) 22 | for(var i = 1; i <= 54; i++) { 23 | var li = document.getElementById("li"+i); 24 | ~(function(i) { 25 | li.onclick = function() { 26 | var thisDiv = this.getElementsByTagName("div")[0]; 27 | var shb = document.getElementById("shift-button"); 28 | if(thisDiv.id == "li-person" && shb.innerText != "show") { //当前位置没人时可单击添加一个人 29 | personNumber++; 30 | thisDiv.id = "li-person"+personNumber; 31 | this.style.background = "rgba(0,0,0,0.2)"; 32 | } else if(thisDiv.id != "li-person-leida1" && thisDiv.id != "li-person-leida2" && thisDiv.id != "li-person-leida3" && shb.innerText != "show") { 33 | var k = 0, l = thisDiv.id.length; 34 | if(l == 10) { //求当前减少的人所在div的id编号 35 | k = parseInt(thisDiv.id[l-1]); 36 | } else { 37 | k = parseInt(thisDiv.id[l-2])*10+parseInt(thisDiv.id[l-1]); 38 | } 39 | for(var j = k+1; j <= personNumber; j++) { //减少一个人需要重新分配位置id 40 | document.getElementById("li-person"+j).id = "li-person"+(j-1); 41 | } 42 | var k1 = 0, l1 = this.id.length; 43 | if(l1 == 3) { //求当前减少的人所在div的id编号 44 | k1 = parseInt(this.id[l1-1]); 45 | } else { 46 | k1 = parseInt(this.id[l1-2])*10+parseInt(this.id[l1-1]); 47 | } 48 | // seatAnimationDetail(k1, "out"); //div移出座位详细控制动画 49 | personNumber--; 50 | thisDiv.id = "li-person"; 51 | this.style.background = "rgba(0,0,0,0)"; 52 | document.getElementsByTagName("p")[k1-1].innerText = ""; //减少单击到的人是立马消失名字和图片 53 | document.getElementsByTagName("img")[k1-1].src = "./image/0.png"; 54 | } 55 | document.getElementById("hide-yn").innerHTML = "Num:"+personNumber; //显示已选位置数量 56 | } 57 | })(i); 58 | } 59 | } 60 | 61 | function allSelect() { //座位全选函数 62 | var li = document.getElementsByTagName("li"); 63 | var shb = document.getElementById("shift-button"); 64 | var alc = document.getElementById("all-choice"); 65 | alc.onclick = function() { 66 | if(shb.innerText != "show") { 67 | for(var i = 0; i < li.length; i++) { 68 | var thisDiv = li[i].getElementsByTagName("div")[0]; 69 | if(thisDiv.id == "li-person") { //当前位置没人时可单击添加一个人 70 | personNumber++; 71 | thisDiv.id = "li-person"+personNumber; 72 | li[i].style.background = "rgba(0,0,0,0.2)"; 73 | } 74 | } 75 | document.getElementById("hide-yn").innerHTML = "Num:"+personNumber; //显示已选位置数量 76 | } 77 | } 78 | } 79 | 80 | function startButton() { //开始分配座位按钮 81 | var start = document.getElementById("start"); 82 | var shb = document.getElementById("shift-button"); 83 | start.onclick = function() { 84 | if(shb.innerText == "seat") { 85 | randomSeat(); //随机分配座位功能实现 86 | setTimeout(function() {seatAnimationIn(1);}, 2000); //div移入座位控制总动画 87 | } 88 | } 89 | } 90 | 91 | function imgInitialize() { //初始化图片(将所有图片变为0.png) 92 | var img = document.getElementsByTagName("img"); 93 | for(var i = 0; i < img.length; i++) { 94 | if(i == 12) { 95 | img[i].src = "./image/leida1.jpg"; 96 | } else if(i == 13) { 97 | img[i].src = "./image/leida2.jpg"; 98 | } else { 99 | img[i].src = "./image/0.png"; 100 | } 101 | } 102 | } 103 | 104 | function randomSeat() { //随机分配座位功能实现 105 | imgInitialize(); //初始化图片(将所有图片变为0.png) 106 | document.getElementById("li-img-leida1").src = "./image/leida1.jpg"; 107 | document.getElementById("li-name14").innerText = "雷老师"; 108 | document.getElementById("li-img-leida2").src = "./image/leida2.jpg"; 109 | document.getElementById("li-name15").innerText = "师母"; 110 | document.getElementById("li-img-leida3").src = "./image/leida3.jpg"; 111 | document.getElementById("li-name49").innerText = "曾前"; 112 | var lple1 = document.getElementById("li-person-leida1"); 113 | setTimeout(function() {lple1.style.left = "0px"; lple1.style.top = "0px";}, 500); 114 | var lple2 = document.getElementById("li-person-leida2"); 115 | setTimeout(function() {lple2.style.left = "0px"; lple2.style.top = "0px";}, 1000); 116 | var lple3 = document.getElementById("li-person-leida3"); 117 | setTimeout(function() {lple3.style.left = "0px"; lple3.style.top = "0px";}, 1500); 118 | var k, a = new Array(), t; 119 | for(var i = 0; i < personNumber; i++) { 120 | a[i] = i; 121 | } 122 | for(var i = 0; i < personNumber-1; i++) { 123 | k = Math.floor(Math.random()*(personNumber-i)); //0~(44-i)的随机数 124 | t = a[k]; 125 | a[k] = a[personNumber-1-i]; 126 | a[personNumber-1-i] = t; 127 | } 128 | for(var i = 0; i < personNumber; i++) { // console.log(a[i]); 129 | var lp = document.getElementById("li-person"+(i+1)); 130 | lp.innerHTML = "
"+personName[a[i]+1]+"
";
131 | }
132 | }
133 |
134 | function seatAnimationDetail(n, io) { //div移入或移出座位详细控制动画,n为第几个div,io控制进入位置或出去动画
135 | if(n <= personNumber) {
136 | var lp = document.getElementById("li-person"+n);
137 | if(io == "in") { //进入位置动画
138 | lp.style.left = "0px";
139 | lp.style.top = "0px";
140 | } else {
141 | if(n == 1) {
142 | lp.style.left = "-100px";
143 | lp.style.top = "0px";
144 | } else if(n == 2) {
145 | lp.style.left = "-206px";
146 | lp.style.top = "10px";
147 | }
148 | }
149 | }
150 | }
151 |
152 | function seatAnimationIn(n) { //div移入座位控制总动画,n要为1
153 | var i = n;
154 | seatAnimationDetail(i, "in");
155 | setTimeout(function() {
156 | if(i < personNumber) {
157 | i++;
158 | seatAnimationIn(i);
159 | }
160 | }, 500);
161 | }
162 |
163 | function shiftButton() { //背景与位置选择框切换功能
164 | var shb = document.getElementById("shift-button");
165 | var seb = document.getElementById("seat-border");
166 | var span = document.getElementsByTagName("span");
167 | var li = document.getElementsByTagName("li");
168 | shb.onclick = function() {
169 | if(shb.innerText == "show") {
170 | seb.style.backgroundPosition = "0px -500px";
171 | shb.innerText = "seat";
172 | // shb.style.bottom = "-45px";
173 | windowZain.setLeft("5px");
174 | windowZain.setTop("10px");
175 | for(var i = 0; i < span.length; i++) {
176 | span[i].style.display = "inline-block";
177 | }
178 | for(var i = 0; i < li.length; i++) {
179 | if(li[i].getElementsByTagName("div")[0].style.left == "0px") {
180 | li[i].getElementsByTagName("div")[0].style.display = "inline-block";
181 | // li[i].style.background = "rgba(0,0,0,0.1)";
182 | }
183 | }
184 | } else {
185 | seb.style.backgroundPosition = "0px 0px";
186 | shb.innerText = "show";
187 | // shb.style.bottom = "100px";
188 | windowZain.setLeft("590px");
189 | windowZain.setTop("450px");
190 | for(var i = 0; i < span.length; i++) {
191 | span[i].style.display = "none";
192 | }
193 | for(var i = 0; i < li.length; i++) {
194 | var lid = li[i].getElementsByTagName("div")[0];
195 | if(lid.style.left == "0px") {
196 | lid.style.display = "none";
197 | li[i].style.background = "rgba(0,0,0,0)";
198 | }
199 | }
200 | }
201 | }
202 | }
203 |
204 | function moveLi() { //鼠标经过li效果
205 | var shb = document.getElementById("shift-button");
206 | var li = document.getElementsByTagName("li");
207 | var i;
208 | for(var i = 0; i < li.length; i++) {
209 | ~(function() {
210 | li[i].onmouseover = function() {
211 | if(shb.innerText == "seat" && this.id != "li14" && this.id != "li15" && this.id != "li49") {
212 | if(this.style.background == "rgba(0, 0, 0, 0)" || this.style.background == "") {
213 | this.style.background = "rgba(0,0,0,0.3)";
214 | this.style.cursor = "pointer";
215 | }
216 | }
217 | }
218 | li[i].onmouseout = function() {
219 | if(shb.innerText == "seat" && this.id != "li14" && this.id != "li15" && this.id != "li49") {
220 | // alert(this.style.background);
221 | if(this.style.background == "rgba(0, 0, 0, 0.298039)" || this.style.background == "rgba(0, 0, 0, 0.3)") {
222 | this.style.background = "rgba(0,0,0,0)";
223 | }
224 | }
225 | }
226 | })();
227 | }
228 | }
229 |
230 | window.onload = Execute //在文档加载完成后才能够去执行,可以避免获取不到对象的情况,同时可以避免定义全局变量和函数
--------------------------------------------------------------------------------
/style/index.css:
--------------------------------------------------------------------------------
1 | @font-face { /*引用外部字体*/
2 | font-family: monaco; /*这里是说明调用来的字体名字*/
3 | src: url('../font/monaco.ttf'); /*这里是字体文件路径*/
4 | }
5 | * {
6 | margin: 0;
7 | padding: 0;
8 | font-family: "Microsoft YaHei", "monaco";
9 | /*background: pink;*/
10 | }
11 | .start {
12 | position: absolute;
13 | z-index: 100;
14 | top: 80px;
15 | width: 100%;
16 | height: 40px;
17 | font-size: 25px;
18 | line-height: 40px;
19 | text-align: center;
20 | color: #fff;
21 | background: rgba(0,0,0,0.3);
22 | }
23 | .start:hover {
24 | cursor: pointer;
25 | color: #eee;
26 | background: rgba(0,0,0,0.2);
27 | }
28 | .select-person {
29 | position: absolute;
30 | z-index: 100;
31 | bottom: 0px;
32 | width: 50px;
33 | height: 50%;
34 | background: rgba(0,0,0,0.2);
35 | }
36 | .select-person:hover {
37 | cursor: pointer;
38 | background: rgba(0,0,0,0.5);
39 | }
40 | .hide-yn {
41 | position: absolute;
42 | z-index: 100;
43 | width: 100%;
44 | height: 100%;
45 | font-size: 20px;
46 | text-align: center;
47 | color: #fff;
48 | }
49 | .hide-yn:hover {
50 | color: #eee;
51 | background: rgba(0,0,0,0.7);
52 | }
53 | .seat-border {
54 | position: relative;
55 | width: 1150px;
56 | height: 600px;
57 | margin: auto;
58 | background: url(../image/logo1_3.png);
59 | background-repeat: no-repeat;
60 | background-position: 0px 0px;
61 | transition: 2s;
62 | -moz-transition: 2s; /* Firefox 4 */
63 | -webkit-transition: 2s; /* Safari 和 Chrome */
64 | -o-transition: 2s; /* Opera */
65 | }
66 | .shift-button,.all-choice {
67 | position: absolute;
68 | width: 100%;
69 | height: 40px;
70 | line-height: 40px;
71 | text-align: center;
72 | font-size: 25px;
73 | color: #fff;
74 | background: rgba(0,0,0,0.7);
75 | transition: 0.5s;
76 | -moz-transition: 0.5s; /* Firefox 4 */
77 | -webkit-transition: 0.5s; /* Safari 和 Chrome */
78 | -o-transition: 0.5s; /* Opera */
79 | }
80 | .shift-button:hover {
81 | cursor: pointer;
82 | background: #555;
83 | }
84 | .all-choice {
85 | top: 40px;
86 | font-size: 18px;
87 | line-height: 40px;
88 | background: rgba(0,0,0,0.5);
89 | }
90 | .all-choice:hover {
91 | cursor: pointer;
92 | background: #555;
93 | }
94 | .seat {
95 | list-style: none;
96 | width: 955px;
97 | height: 500px;
98 | margin: auto;
99 | /*background: rgba(255,255,255,1);*/
100 | }
101 | .seat li {
102 | position: relative;
103 | float: left;
104 | width: 90px;
105 | height: 115px;
106 | margin-top: 5px;
107 | margin-right: 8px;
108 | margin-left: 8px;
109 | -moz-border-radius: 10px; /* Gecko browsers */
110 | -webkit-border-radius: 10px; /* Webkit browsers */
111 | border-radius: 10px; /* W3C syntax */
112 | /*background: rgba(0,0,0,0.2);*/
113 | }
114 | .seat li:hover {
115 | cursor: pointer;
116 | /*background: rgba(0,0,0,0.3);*/
117 | }
118 | .seat #li14,.seat #li15 {
119 | background: rgba(240,154,154,0);
120 | }
121 | .seat #li14:hover,.seat #li15:hover {
122 | cursor: default;
123 | }
124 | .seat li div,.seat li h1 {
125 | overflow: hidden;
126 | position: absolute;
127 | width: 100%;
128 | height: 100%;
129 | background: rgba(0,255,255,0.1);
130 | -moz-border-radius: 10px; /* Gecko browsers */
131 | -webkit-border-radius: 10px; /* Webkit browsers */
132 | border-radius: 10px; /* W3C syntax */
133 | transition: 0.5s;
134 | -moz-transition: 0.5s; /* Firefox 4 */
135 | -webkit-transition: 0.5s; /* Safari 和 Chrome */
136 | -o-transition: 0.5s; /* Opera */
137 | }
138 | .li-person1 {
139 | z-index: 1;
140 | left: -100px;
141 | }
142 | .li-person2 {
143 | z-index: 2;
144 | left: -206px;
145 | top: 10px;
146 | }
147 | .li-person3 {
148 | z-index: 3;
149 | left: -312px;
150 | top: 20px;
151 | }
152 | .li-person4 {
153 | z-index: 4;
154 | left: -418px;
155 | top: 30px;
156 | }
157 | .li-person5 {
158 | z-index: 5;
159 | left: -524px;
160 | top: 40px;
161 | }
162 | .li-person6 {
163 | z-index: 9;
164 | left: 418px;
165 | top: 0px;
166 | }
167 | .li-person7 {
168 | z-index: 8;
169 | left: 312px;
170 | top: 10px;
171 | }
172 | .li-person8 {
173 | z-index: 7;
174 | left: 206px;
175 | top: 20px;
176 | }
177 | .li-person9 {
178 | z-index: 6;
179 | left: 100px;
180 | top: 30px;
181 | }
182 | .li-person10 {
183 | z-index: 10;
184 | left: -100px;
185 | top: 0px;
186 | }
187 | .li-person11 {
188 | z-index: 11;
189 | left: -206px;
190 | top: 10px;
191 | }
192 | .li-person12 {
193 | z-index: 12;
194 | left: -312px;
195 | top: 20px;
196 | }
197 | .li-person13 {
198 | z-index: 13;
199 | left: -418px;
200 | top: 20px;
201 | }
202 | .li-person14 {
203 | z-index: 18;
204 | left: 524px;
205 | top: 0px;
206 | transition: 0.5s;
207 | }
208 | .li-person15 {
209 | z-index: 17;
210 | left: 418px;
211 | top: 10px;
212 | transition: 0.5s;
213 | }
214 | .li-person16 {
215 | z-index: 16;
216 | left: 312px;
217 | top: 20px;
218 | transition: 0.5s;
219 | }
220 | .li-person17 {
221 | z-index: 15;
222 | left: 206px;
223 | top: 30px;
224 | transition: 0.5s;
225 | }
226 | .li-person18 {
227 | z-index: 14;
228 | left: 100px;
229 | top: 40px;
230 | transition: 0.5s;
231 | }
232 | .li-person19 {
233 | z-index: 19;
234 | left: -100px;
235 | top: 0px;
236 | transition: 0.5s;
237 | }
238 | .li-person20 {
239 | z-index: 20;
240 | left: -206px;
241 | top: 10px;
242 | transition: 0.5s;
243 | }
244 | .li-person21 {
245 | z-index: 21;
246 | left: -312px;
247 | top: 20px;
248 | transition: 0.5s;
249 | }
250 | .li-person22 {
251 | z-index: 22;
252 | left: -418px;
253 | top: 30px;
254 | transition: 0.5s;
255 | }
256 | .li-person23 {
257 | z-index: 23;
258 | left: -524px;
259 | top: 40px;
260 | transition: 0.5s;
261 | }
262 | .li-person24 {
263 | z-index: 27;
264 | left: 418px;
265 | top: 0px;
266 | transition: 0.5s;
267 | }
268 | .li-person25 {
269 | z-index: 26;
270 | left: 312px;
271 | top: 10px;
272 | transition: 0.5s;
273 | }
274 | .li-person26 {
275 | z-index: 25;
276 | left: 206px;
277 | top: 20px;
278 | transition: 0.5s;
279 | }
280 | .li-person27 {
281 | z-index: 24;
282 | left: 100px;
283 | top: 30px;
284 | transition: 0.5s;
285 | }
286 | .li-person28 {
287 | z-index: 28;
288 | left: -100px;
289 | top: 0px;
290 | transition: 0.5s;
291 | }
292 | .li-person29 {
293 | z-index: 29;
294 | left: -206px;
295 | top: 10px;
296 | transition: 0.5s;
297 | }
298 | .li-person30 {
299 | z-index: 30;
300 | left: -312px;
301 | top: 20px;
302 | transition: 0.5s;
303 | }
304 | .li-person31 {
305 | z-index: 31;
306 | left: -418px;
307 | top: 20px;
308 | transition: 0.5s;
309 | }
310 | .li-person32 {
311 | z-index: 36;
312 | left: 524px;
313 | top: 0px;
314 | transition: 0.5s;
315 | }
316 | .li-person33 {
317 | z-index: 33;
318 | left: 418px;
319 | top: 10px;
320 | transition: 0.5s;
321 | }
322 | .li-person34 {
323 | z-index: 34;
324 | left: 312px;
325 | top: 20px;
326 | transition: 0.5s;
327 | }
328 | .li-person35 {
329 | z-index: 33;
330 | left: 206px;
331 | top: 30px;
332 | transition: 0.5s;
333 | }
334 | .li-person36 {
335 | z-index: 32;
336 | left: 100px;
337 | top: 40px;
338 | transition: 0.5s;
339 | }
340 | .li-person37 {
341 | z-index: 37;
342 | left: -100px;
343 | top: 0px;
344 | transition: 0.5s;
345 | }
346 | .li-person38 {
347 | z-index: 38;
348 | left: -206px;
349 | top: 10px;
350 | transition: 0.5s;
351 | }
352 | .li-person39 {
353 | z-index: 39;
354 | left: -312px;
355 | top: 20px;
356 | transition: 0.5s;
357 | }
358 | .li-person40 {
359 | z-index: 40;
360 | left: -418px;
361 | top: 30px;
362 | transition: 0.5s;
363 | }
364 | .li-person41 {
365 | z-index: 41;
366 | left: -524px;
367 | top: 40px;
368 | transition: 0.5s;
369 | }
370 | .li-person42 {
371 | z-index: 45;
372 | left: 418px;
373 | top: 0px;
374 | transition: 0.5s;
375 | }
376 | .li-person43 {
377 | z-index: 44;
378 | left: 312px;
379 | top: 10px;
380 | transition: 0.5s;
381 | }
382 | .li-person44 {
383 | z-index: 43;
384 | left: 206px;
385 | top: 20px;
386 | transition: 0.5s;
387 | }
388 | .li-person45 {
389 | z-index: 42;
390 | left: 100px;
391 | top: 30px;
392 | transition: 0.5s;
393 | }
394 | .li-person46 {
395 | z-index: 28;
396 | left: -100px;
397 | top: 0px;
398 | transition: 0.5s;
399 | }
400 | .li-person47 {
401 | z-index: 29;
402 | left: -206px;
403 | top: 10px;
404 | transition: 0.5s;
405 | }
406 | .li-person48 {
407 | z-index: 30;
408 | left: -312px;
409 | top: 20px;
410 | transition: 0.5s;
411 | }
412 | .li-person49 {
413 | z-index: 31;
414 | left: -418px;
415 | top: 20px;
416 | transition: 0.5s;
417 | }
418 | .li-person50 {
419 | z-index: 36;
420 | left: 524px;
421 | top: 0px;
422 | transition: 0.5s;
423 | }
424 | .li-person51 {
425 | z-index: 33;
426 | left: 418px;
427 | top: 10px;
428 | transition: 0.5s;
429 | }
430 | .li-person52 {
431 | z-index: 34;
432 | left: 312px;
433 | top: 20px;
434 | transition: 0.5s;
435 | }
436 | .li-person53 {
437 | z-index: 33;
438 | left: 206px;
439 | top: 30px;
440 | transition: 0.5s;
441 | }
442 | .li-person54 {
443 | z-index: 32;
444 | left: 100px;
445 | top: 40px;
446 | transition: 0.5s;
447 | }
448 | .seat li div p {
449 | position: absolute;
450 | bottom: 0px;
451 | width: 100%;
452 | text-align: center;
453 | height: 20px;
454 | line-height: 20px;
455 | font-size: 14px;
456 | color: #fff;
457 | background: rgba(0,0,0,0.5);
458 | }
459 | .seat li img {
460 | width: 100%;
461 | height: 100%;
462 | }
463 | .seat li span {
464 | display: none;
465 | position: absolute;
466 | z-index: 200;
467 | bottom: 20px;
468 | width: 100%;
469 | text-align: center;
470 | line-height: 20px;
471 | font-size: 14px;
472 | color: #fff;
473 | background: rgba(0,0,0,0.5);
474 | }
475 | .seat #li14 span,.seat #li15 span,.seat #li49 span {
476 | background: rgba(0,0,0,0.8);
477 | }
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
28 |
36 |
44 |
52 |
60 |
67 |
68 |
75 |
76 |
83 |
84 |
91 |
92 |
100 |
108 |
116 |
124 |
132 |
140 |
148 |
156 |
164 |
172 |
180 |
188 |
196 |
204 |
212 |
220 |
228 |
236 |
244 |
252 |
260 |
268 |
276 |
284 |
292 |
300 |
308 |
316 |
324 |
332 |
340 |
348 |
356 |
364 |
372 |
380 |
389 |
397 |
405 |
413 |
421 |
429 |
437 |
445 |
453 |
";
131 | }
132 | }
133 |
134 | function seatAnimationDetail(n, io) { //div移入或移出座位详细控制动画,n为第几个div,io控制进入位置或出去动画
135 | if(n <= personNumber) {
136 | var lp = document.getElementById("li-person"+n);
137 | if(io == "in") { //进入位置动画
138 | lp.style.left = "0px";
139 | lp.style.top = "0px";
140 | } else {
141 | if(n == 1) {
142 | lp.style.left = "-100px";
143 | lp.style.top = "0px";
144 | } else if(n == 2) {
145 | lp.style.left = "-206px";
146 | lp.style.top = "10px";
147 | }
148 | }
149 | }
150 | }
151 |
152 | function seatAnimationIn(n) { //div移入座位控制总动画,n要为1
153 | var i = n;
154 | seatAnimationDetail(i, "in");
155 | setTimeout(function() {
156 | if(i < personNumber) {
157 | i++;
158 | seatAnimationIn(i);
159 | }
160 | }, 500);
161 | }
162 |
163 | function shiftButton() { //背景与位置选择框切换功能
164 | var shb = document.getElementById("shift-button");
165 | var seb = document.getElementById("seat-border");
166 | var span = document.getElementsByTagName("span");
167 | var li = document.getElementsByTagName("li");
168 | shb.onclick = function() {
169 | if(shb.innerText == "show") {
170 | seb.style.backgroundPosition = "0px -500px";
171 | shb.innerText = "seat";
172 | // shb.style.bottom = "-45px";
173 | windowZain.setLeft("5px");
174 | windowZain.setTop("10px");
175 | for(var i = 0; i < span.length; i++) {
176 | span[i].style.display = "inline-block";
177 | }
178 | for(var i = 0; i < li.length; i++) {
179 | if(li[i].getElementsByTagName("div")[0].style.left == "0px") {
180 | li[i].getElementsByTagName("div")[0].style.display = "inline-block";
181 | // li[i].style.background = "rgba(0,0,0,0.1)";
182 | }
183 | }
184 | } else {
185 | seb.style.backgroundPosition = "0px 0px";
186 | shb.innerText = "show";
187 | // shb.style.bottom = "100px";
188 | windowZain.setLeft("590px");
189 | windowZain.setTop("450px");
190 | for(var i = 0; i < span.length; i++) {
191 | span[i].style.display = "none";
192 | }
193 | for(var i = 0; i < li.length; i++) {
194 | var lid = li[i].getElementsByTagName("div")[0];
195 | if(lid.style.left == "0px") {
196 | lid.style.display = "none";
197 | li[i].style.background = "rgba(0,0,0,0)";
198 | }
199 | }
200 | }
201 | }
202 | }
203 |
204 | function moveLi() { //鼠标经过li效果
205 | var shb = document.getElementById("shift-button");
206 | var li = document.getElementsByTagName("li");
207 | var i;
208 | for(var i = 0; i < li.length; i++) {
209 | ~(function() {
210 | li[i].onmouseover = function() {
211 | if(shb.innerText == "seat" && this.id != "li14" && this.id != "li15" && this.id != "li49") {
212 | if(this.style.background == "rgba(0, 0, 0, 0)" || this.style.background == "") {
213 | this.style.background = "rgba(0,0,0,0.3)";
214 | this.style.cursor = "pointer";
215 | }
216 | }
217 | }
218 | li[i].onmouseout = function() {
219 | if(shb.innerText == "seat" && this.id != "li14" && this.id != "li15" && this.id != "li49") {
220 | // alert(this.style.background);
221 | if(this.style.background == "rgba(0, 0, 0, 0.298039)" || this.style.background == "rgba(0, 0, 0, 0.3)") {
222 | this.style.background = "rgba(0,0,0,0)";
223 | }
224 | }
225 | }
226 | })();
227 | }
228 | }
229 |
230 | window.onload = Execute //在文档加载完成后才能够去执行,可以避免获取不到对象的情况,同时可以避免定义全局变量和函数
--------------------------------------------------------------------------------
/style/index.css:
--------------------------------------------------------------------------------
1 | @font-face { /*引用外部字体*/
2 | font-family: monaco; /*这里是说明调用来的字体名字*/
3 | src: url('../font/monaco.ttf'); /*这里是字体文件路径*/
4 | }
5 | * {
6 | margin: 0;
7 | padding: 0;
8 | font-family: "Microsoft YaHei", "monaco";
9 | /*background: pink;*/
10 | }
11 | .start {
12 | position: absolute;
13 | z-index: 100;
14 | top: 80px;
15 | width: 100%;
16 | height: 40px;
17 | font-size: 25px;
18 | line-height: 40px;
19 | text-align: center;
20 | color: #fff;
21 | background: rgba(0,0,0,0.3);
22 | }
23 | .start:hover {
24 | cursor: pointer;
25 | color: #eee;
26 | background: rgba(0,0,0,0.2);
27 | }
28 | .select-person {
29 | position: absolute;
30 | z-index: 100;
31 | bottom: 0px;
32 | width: 50px;
33 | height: 50%;
34 | background: rgba(0,0,0,0.2);
35 | }
36 | .select-person:hover {
37 | cursor: pointer;
38 | background: rgba(0,0,0,0.5);
39 | }
40 | .hide-yn {
41 | position: absolute;
42 | z-index: 100;
43 | width: 100%;
44 | height: 100%;
45 | font-size: 20px;
46 | text-align: center;
47 | color: #fff;
48 | }
49 | .hide-yn:hover {
50 | color: #eee;
51 | background: rgba(0,0,0,0.7);
52 | }
53 | .seat-border {
54 | position: relative;
55 | width: 1150px;
56 | height: 600px;
57 | margin: auto;
58 | background: url(../image/logo1_3.png);
59 | background-repeat: no-repeat;
60 | background-position: 0px 0px;
61 | transition: 2s;
62 | -moz-transition: 2s; /* Firefox 4 */
63 | -webkit-transition: 2s; /* Safari 和 Chrome */
64 | -o-transition: 2s; /* Opera */
65 | }
66 | .shift-button,.all-choice {
67 | position: absolute;
68 | width: 100%;
69 | height: 40px;
70 | line-height: 40px;
71 | text-align: center;
72 | font-size: 25px;
73 | color: #fff;
74 | background: rgba(0,0,0,0.7);
75 | transition: 0.5s;
76 | -moz-transition: 0.5s; /* Firefox 4 */
77 | -webkit-transition: 0.5s; /* Safari 和 Chrome */
78 | -o-transition: 0.5s; /* Opera */
79 | }
80 | .shift-button:hover {
81 | cursor: pointer;
82 | background: #555;
83 | }
84 | .all-choice {
85 | top: 40px;
86 | font-size: 18px;
87 | line-height: 40px;
88 | background: rgba(0,0,0,0.5);
89 | }
90 | .all-choice:hover {
91 | cursor: pointer;
92 | background: #555;
93 | }
94 | .seat {
95 | list-style: none;
96 | width: 955px;
97 | height: 500px;
98 | margin: auto;
99 | /*background: rgba(255,255,255,1);*/
100 | }
101 | .seat li {
102 | position: relative;
103 | float: left;
104 | width: 90px;
105 | height: 115px;
106 | margin-top: 5px;
107 | margin-right: 8px;
108 | margin-left: 8px;
109 | -moz-border-radius: 10px; /* Gecko browsers */
110 | -webkit-border-radius: 10px; /* Webkit browsers */
111 | border-radius: 10px; /* W3C syntax */
112 | /*background: rgba(0,0,0,0.2);*/
113 | }
114 | .seat li:hover {
115 | cursor: pointer;
116 | /*background: rgba(0,0,0,0.3);*/
117 | }
118 | .seat #li14,.seat #li15 {
119 | background: rgba(240,154,154,0);
120 | }
121 | .seat #li14:hover,.seat #li15:hover {
122 | cursor: default;
123 | }
124 | .seat li div,.seat li h1 {
125 | overflow: hidden;
126 | position: absolute;
127 | width: 100%;
128 | height: 100%;
129 | background: rgba(0,255,255,0.1);
130 | -moz-border-radius: 10px; /* Gecko browsers */
131 | -webkit-border-radius: 10px; /* Webkit browsers */
132 | border-radius: 10px; /* W3C syntax */
133 | transition: 0.5s;
134 | -moz-transition: 0.5s; /* Firefox 4 */
135 | -webkit-transition: 0.5s; /* Safari 和 Chrome */
136 | -o-transition: 0.5s; /* Opera */
137 | }
138 | .li-person1 {
139 | z-index: 1;
140 | left: -100px;
141 | }
142 | .li-person2 {
143 | z-index: 2;
144 | left: -206px;
145 | top: 10px;
146 | }
147 | .li-person3 {
148 | z-index: 3;
149 | left: -312px;
150 | top: 20px;
151 | }
152 | .li-person4 {
153 | z-index: 4;
154 | left: -418px;
155 | top: 30px;
156 | }
157 | .li-person5 {
158 | z-index: 5;
159 | left: -524px;
160 | top: 40px;
161 | }
162 | .li-person6 {
163 | z-index: 9;
164 | left: 418px;
165 | top: 0px;
166 | }
167 | .li-person7 {
168 | z-index: 8;
169 | left: 312px;
170 | top: 10px;
171 | }
172 | .li-person8 {
173 | z-index: 7;
174 | left: 206px;
175 | top: 20px;
176 | }
177 | .li-person9 {
178 | z-index: 6;
179 | left: 100px;
180 | top: 30px;
181 | }
182 | .li-person10 {
183 | z-index: 10;
184 | left: -100px;
185 | top: 0px;
186 | }
187 | .li-person11 {
188 | z-index: 11;
189 | left: -206px;
190 | top: 10px;
191 | }
192 | .li-person12 {
193 | z-index: 12;
194 | left: -312px;
195 | top: 20px;
196 | }
197 | .li-person13 {
198 | z-index: 13;
199 | left: -418px;
200 | top: 20px;
201 | }
202 | .li-person14 {
203 | z-index: 18;
204 | left: 524px;
205 | top: 0px;
206 | transition: 0.5s;
207 | }
208 | .li-person15 {
209 | z-index: 17;
210 | left: 418px;
211 | top: 10px;
212 | transition: 0.5s;
213 | }
214 | .li-person16 {
215 | z-index: 16;
216 | left: 312px;
217 | top: 20px;
218 | transition: 0.5s;
219 | }
220 | .li-person17 {
221 | z-index: 15;
222 | left: 206px;
223 | top: 30px;
224 | transition: 0.5s;
225 | }
226 | .li-person18 {
227 | z-index: 14;
228 | left: 100px;
229 | top: 40px;
230 | transition: 0.5s;
231 | }
232 | .li-person19 {
233 | z-index: 19;
234 | left: -100px;
235 | top: 0px;
236 | transition: 0.5s;
237 | }
238 | .li-person20 {
239 | z-index: 20;
240 | left: -206px;
241 | top: 10px;
242 | transition: 0.5s;
243 | }
244 | .li-person21 {
245 | z-index: 21;
246 | left: -312px;
247 | top: 20px;
248 | transition: 0.5s;
249 | }
250 | .li-person22 {
251 | z-index: 22;
252 | left: -418px;
253 | top: 30px;
254 | transition: 0.5s;
255 | }
256 | .li-person23 {
257 | z-index: 23;
258 | left: -524px;
259 | top: 40px;
260 | transition: 0.5s;
261 | }
262 | .li-person24 {
263 | z-index: 27;
264 | left: 418px;
265 | top: 0px;
266 | transition: 0.5s;
267 | }
268 | .li-person25 {
269 | z-index: 26;
270 | left: 312px;
271 | top: 10px;
272 | transition: 0.5s;
273 | }
274 | .li-person26 {
275 | z-index: 25;
276 | left: 206px;
277 | top: 20px;
278 | transition: 0.5s;
279 | }
280 | .li-person27 {
281 | z-index: 24;
282 | left: 100px;
283 | top: 30px;
284 | transition: 0.5s;
285 | }
286 | .li-person28 {
287 | z-index: 28;
288 | left: -100px;
289 | top: 0px;
290 | transition: 0.5s;
291 | }
292 | .li-person29 {
293 | z-index: 29;
294 | left: -206px;
295 | top: 10px;
296 | transition: 0.5s;
297 | }
298 | .li-person30 {
299 | z-index: 30;
300 | left: -312px;
301 | top: 20px;
302 | transition: 0.5s;
303 | }
304 | .li-person31 {
305 | z-index: 31;
306 | left: -418px;
307 | top: 20px;
308 | transition: 0.5s;
309 | }
310 | .li-person32 {
311 | z-index: 36;
312 | left: 524px;
313 | top: 0px;
314 | transition: 0.5s;
315 | }
316 | .li-person33 {
317 | z-index: 33;
318 | left: 418px;
319 | top: 10px;
320 | transition: 0.5s;
321 | }
322 | .li-person34 {
323 | z-index: 34;
324 | left: 312px;
325 | top: 20px;
326 | transition: 0.5s;
327 | }
328 | .li-person35 {
329 | z-index: 33;
330 | left: 206px;
331 | top: 30px;
332 | transition: 0.5s;
333 | }
334 | .li-person36 {
335 | z-index: 32;
336 | left: 100px;
337 | top: 40px;
338 | transition: 0.5s;
339 | }
340 | .li-person37 {
341 | z-index: 37;
342 | left: -100px;
343 | top: 0px;
344 | transition: 0.5s;
345 | }
346 | .li-person38 {
347 | z-index: 38;
348 | left: -206px;
349 | top: 10px;
350 | transition: 0.5s;
351 | }
352 | .li-person39 {
353 | z-index: 39;
354 | left: -312px;
355 | top: 20px;
356 | transition: 0.5s;
357 | }
358 | .li-person40 {
359 | z-index: 40;
360 | left: -418px;
361 | top: 30px;
362 | transition: 0.5s;
363 | }
364 | .li-person41 {
365 | z-index: 41;
366 | left: -524px;
367 | top: 40px;
368 | transition: 0.5s;
369 | }
370 | .li-person42 {
371 | z-index: 45;
372 | left: 418px;
373 | top: 0px;
374 | transition: 0.5s;
375 | }
376 | .li-person43 {
377 | z-index: 44;
378 | left: 312px;
379 | top: 10px;
380 | transition: 0.5s;
381 | }
382 | .li-person44 {
383 | z-index: 43;
384 | left: 206px;
385 | top: 20px;
386 | transition: 0.5s;
387 | }
388 | .li-person45 {
389 | z-index: 42;
390 | left: 100px;
391 | top: 30px;
392 | transition: 0.5s;
393 | }
394 | .li-person46 {
395 | z-index: 28;
396 | left: -100px;
397 | top: 0px;
398 | transition: 0.5s;
399 | }
400 | .li-person47 {
401 | z-index: 29;
402 | left: -206px;
403 | top: 10px;
404 | transition: 0.5s;
405 | }
406 | .li-person48 {
407 | z-index: 30;
408 | left: -312px;
409 | top: 20px;
410 | transition: 0.5s;
411 | }
412 | .li-person49 {
413 | z-index: 31;
414 | left: -418px;
415 | top: 20px;
416 | transition: 0.5s;
417 | }
418 | .li-person50 {
419 | z-index: 36;
420 | left: 524px;
421 | top: 0px;
422 | transition: 0.5s;
423 | }
424 | .li-person51 {
425 | z-index: 33;
426 | left: 418px;
427 | top: 10px;
428 | transition: 0.5s;
429 | }
430 | .li-person52 {
431 | z-index: 34;
432 | left: 312px;
433 | top: 20px;
434 | transition: 0.5s;
435 | }
436 | .li-person53 {
437 | z-index: 33;
438 | left: 206px;
439 | top: 30px;
440 | transition: 0.5s;
441 | }
442 | .li-person54 {
443 | z-index: 32;
444 | left: 100px;
445 | top: 40px;
446 | transition: 0.5s;
447 | }
448 | .seat li div p {
449 | position: absolute;
450 | bottom: 0px;
451 | width: 100%;
452 | text-align: center;
453 | height: 20px;
454 | line-height: 20px;
455 | font-size: 14px;
456 | color: #fff;
457 | background: rgba(0,0,0,0.5);
458 | }
459 | .seat li img {
460 | width: 100%;
461 | height: 100%;
462 | }
463 | .seat li span {
464 | display: none;
465 | position: absolute;
466 | z-index: 200;
467 | bottom: 20px;
468 | width: 100%;
469 | text-align: center;
470 | line-height: 20px;
471 | font-size: 14px;
472 | color: #fff;
473 | background: rgba(0,0,0,0.5);
474 | }
475 | .seat #li14 span,.seat #li15 span,.seat #li49 span {
476 | background: rgba(0,0,0,0.8);
477 | }
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |