首页运维零件 › 最外面的div设置overflowvns威尼斯城官网登入:

最外面的div设置overflowvns威尼斯城官网登入:

init();

复制代码 代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"
/>
<title>无标题文档</title>
<style type="text/css">
* {margin:0px;padding:0px;}
html,body { height:100%;}
body { font-size:14px; line-height:24px;}
#tip {
position: absolute;
right: 0px;
bottom: 0px;
height: 0px;
width: 180px;
border: 1px solid #CCCCCC;
background-color: #eeeeee;
padding: 1px;
overflow:hidden;
display:none;
font-size:12px;
z-index:10;
}
#tip p { padding:6px;}
#tip h1,#detail h1 {
font-size:14px;
height:25px;
line-height:25px;
background-color:#0066CC;
color:#FFFFFF;
padding:0px 3px 0px 3px;
filter: Alpha(Opacity=100);
}
#tip h1 a,#detail h1 a {
float:right;
text-decoration:none;
color:#FFFFFF;
}
#shadow {
position:absolute;
width:100%;
height:100%;
background-color:#000000;
z-index:11;
filter: Alpha(Opacity=70);
display:none;
overflow:hidden;
}
#detail {
width:500px;
height:200px;
border:3px double #ccc;
background-color:#FFFFFF;
position:absolute;
z-index:30;
display:none;
left:30%;
top:30%
}
</style>
<script type="text/javascript">
var handle;
function start()
{
var obj = document.getElementById("tip");
if (parseInt(obj.style.height)==0)
{ obj.style.display="block";
  handle = setInterval("changeH('up')",2);
}else
{
     handle = setInterval("changeH('down')",2)
}
}
function changeH(str)
{
var obj = document.getElementById("tip");
if(str=="up")
{
  if (parseInt(obj.style.height)>200)
   clearInterval(handle);
  else
   obj.style.height=(parseInt(obj.style.height)+8).toString()+"px";
}
if(str=="down")
{
  if (parseInt(obj.style.height)<8)
  { clearInterval(handle);
   obj.style.display="none";
  }
  else 
   obj.style.height=(parseInt(obj.style.height)-8).toString()+"px";
}
}
function showwin()
{
document.getElementsByTagName("html")[0].style.overflow = "hidden";
start();
document.getElementById("shadow").style.display="block";
document.getElementById("detail").style.display="block";
}
function recover()
{
document.getElementsByTagName("html")[0].style.overflow = "auto";
document.getElementById("shadow").style.display="none";
document.getElementById("detail").style.display="none"; 
}
</script>
</head>
<body
onload="document.getElementById('tip').style.height='0px'">
<div id="shadow"> </div>
<div id="detail">

<!--开始-->
<style type="text/css">
#msg_win{position:absolute;right:0px;display:none;overflow:hidden;z-index:99;border:1px
solid
#c00;background:#F9EFFC;width:210px;font-size:12px;margin:0px;}
#msg_win
.icos{position:absolute;top:2px;*top:0px;right:2px;z-index:9;}
.icos
a{float:left;color:#FFFFFF;margin:1px;text-align:center;font-weight:bold;width:14px;height:22px;line-height:22px;padding:1px;text-decoration:none;font-family:webdings;}
.icos a:hover{color:#FFCC00;}
#msg_title{background:#FA6705;border-bottom:1px solid
#710B97;border-top:1px solid #FFF;border-left:1px solid
#FFF;color:#FFFFFF;height:25px;line-height:25px;text-indent:5px;font-weight:bold;}
#msg_content{margin:1px;margin-right:0;width:210px;height:160px;overflow:hidden;
text-align:center}
</style>
<!--结束-->

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
body,html{
width: 100%;
height: 100%;
background: #000;
font-size: 14px;
overflow: hidden;
font-family: "华康少女文字W5(P)";
}
#playAir{
width: 320px;
height: 568px;
background: url(img/bg.jpg)no-repeat;
border: 5px solid #ddd;
margin: 100px auto;
overflow: hidden;
position: relative;
}
#playAir .bg{
width: 320px;
height: 568px;
background: url(img/start.png)no-repeat;
position: relative;
}
#playAir .bg ul{
position: absolute;
bottom: 50px;
left: 50%;
margin-left: -82px;
list-style: none;
}
#playAir .bg ul li{
width: 160px;
height: 40px;
background: #abcdef;
border: 2px solid #ddd;
margin-top: 20px;
text-align: center;
line-height: 40px;
border-radius: 30px;
color: #eee;
cursor: pointer;
}
#playAir .bg p{
position: absolute;
bottom: 5px;
right: 5px;
font-size: 10px;
color: #666;
font-style: oblique;
}
#playAir .myPlane{
position: absolute;
top: 0;
left: 0;
}
#playAir .bullet{
position: absolute;
top: 0;
left: 0;
}
#playAir .enemy{
position: absolute;
top: 0;
left: 0;
}
#playAir .enPlane{
position: absolute;

a{font-size:14px} #box{width:400px;height:20px;overflow:hidden;}
#title{color:#000;width:400px;height:20px;font-size:14px;line-height:18px;/*background-color:#FF0000*/}
varhandle; varhandle2; varboxW=0; vartitleNum=0; functioninit(){
varnewsTitles="快乐笛子的博客|中央统战部:新社会阶层纳入中国统一战线|中俄明年将在俄远东地区举行联合反恐演|广州宾馆3小时内须将旅客信息传给公安机关|国亲将推动弹劾陈水扁案";
varnewsLinks="";
document.getElementById.style.width="400px";
document.getElementById.innerHTML=""+newsTitles.split[titleNum]+"";
//setTimeout;",1500); titleNum++;
setInterval("innerTitle('"+newsTitles+"','"+newsLinks+"')",3100); }
functioninnerTitle{ vart=titles.split; vara=links.split; if titleNum=0;
document.getElementById.style.width="0px";
document.getElementById.innerHTML=""+t[titleNum]+"";
handle2=setInterval;//展开 titleNum++; } functionincreaseBoxW(){
boxW=parseInt(document.getElementById; boxW=boxW+4; if{ clearInterval;
document.getElementById.style.width="400px"; setTimeout",1500) }else{
document.getElementById.style.width=boxW+"px"; } }
functiondecreaseBoxW(){ handle=setInterval } functiondecreaseBoxW2(){
boxW=parseInt(document.getElementById; boxW=boxW-16; if{ clearInterval;
document.getElementById.style.width="0px"; }else{
document.getElementById.style.width=boxW+"px"; } }

代码如下: %@ page language="java"
import="java.util.*" pageEncoding="UTF-8"% % String path =
request.getContextPath(); String basePath =
request.getScheme()+"://"+...

</div>
<div id="tip"><h1><a href="javascript:void(0)"
onclick="start()">×</a>您有新消息</h1><p><a
href="javascript:void(0)"
onclick="showwin()">点击这里查看详细</a></p></div>
<p><a href="#"
onclick="start()">点击这里测试</a><br><br><br><br>
<!--NEWSZW_HZH_BEGIN-->

<div id="msg_win"
style="display:block;top:503px;visibility:visible;opacity:1;">
<div class="icos"><a id="msg_min" title="最小化"
href="javascript:void%200">_</a><a id="msg_close"
title="关闭" href="javascript:void%200">×</a></div>
<div id="msg_title">标题
</div>
<div id="msg_content">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase=""
width="210" height="160">
<param name="movie"
value="flvplayer.swf?vcastr_file=userlogin/video/qlg.flv&IsAutoPlay=1"/>
<param name="quality" value="high"/>
<param name="allowFullScreen" value="true" />
<embed
src="flvplayer.swf?vcastr_file=userlogin/video/qlg.flv&IsAutoPlay=1"
allowFullScreen="true" quality="high"
pluginspage=""
type="application/x-shockwave-flash" width="210"
height="160"></embed>
</object>
</div>
</div>
<script type="text/javascript">
var Message = {
set: function () {//最小化与恢复状态切换
var set = this.minbtn.status == 1 ? [0, 1, 'block', this.char[0],
'最小化'] : [1, 0, 'none', this.char[1], '恢复'];
this.minbtn.status = set[0];
this.win.style.borderBottomWidth = set[1];
this.content.style.display = set[2];
this.minbtn.innerHTML = set[3]
this.minbtn.title = set[4];
this.win.style.top = this.getY().top;
},
close: function () {//关闭
this.win.style.display = 'none';
document.all.xhs1.stop();
window.onscroll = null;
},
setOpacity: function (x) {//设置透明度
var v = x >= 100 ? '' : 'Alpha(opacity=' + x + ')';
this.win.style.visibility = x <= 0 ? 'hidden' : 'visible';
//IE有绝对或相对定位内容不随父透明度变化的bug
this.win.style.filter = v;
this.win.style.opacity = x / 100;
},
show: function () {//渐显
clearInterval(this.timer2);
var me = this, fx = this.fx(0, 100, 0.1), t = 0;
this.timer2 = setInterval(function () {
t = fx();
me.setOpacity(t[0]);
if (t[1] == 0) { clearInterval(me.timer2) }
}, 6); //10 to 6
},
fx: function (a, b, c) {//缓冲计算
var cMath = Math[(a - b) > 0 ? "floor" : "ceil"], c = c || 0.1;
return function () { return [a += cMath((b - a) * c), a - b] }
},
getY: function () {//计算移动坐标
var d = document, b = document.body, e = document.documentElement;
var s = Math.max(b.scrollTop, e.scrollTop);
var h = /BackCompat/i.test(document.compatMode) ? b.clientHeight :
e.clientHeight;
var h2 = this.win.offsetHeight;
return { foot: s + h + h2 + 2 + 'px', top: s + h - h2 - 2 + 'px' }
},
moveTo: function (y) {//移动动画
clearInterval(this.timer);
var me = this, a = parseInt(this.win.style.top) || 0;
var fx = this.fx(a, parseInt(y));
var t = 0;
this.timer = setInterval(function () {
t = fx();
me.win.style.top = t[0] + 'px';
if (t[1] == 0) {
clearInterval(me.timer);
me.bind();
}
}, 6); //10 to 6
},
bind: function () {//绑定窗口滚动条与大小变化事件
var me = this, st, rt;
window.onscroll = function () {
clearTimeout(st);
clearTimeout(me.timer2);
me.setOpacity(0);
st = setTimeout(function () {
me.win.style.top = me.getY().top;
me.show();
}, 100); //600 mod 100
};
window.onresize = function () {
clearTimeout(rt);
rt = setTimeout(function () { me.win.style.top = me.getY().top },
100);
}
},
init: function () {//创建HTML
function $(id) { return document.getElementById(id) };
this.win = $('msg_win');
var set = { minbtn: 'msg_min', closebtn: 'msg_close', title:
'msg_title', content: 'msg_content' };
for (var Id in set) { this[Id] = $(set[Id]) };
var me = this;
this.minbtn.onclick = function () { me.set(); this.blur() };
this.closebtn.onclick = function () { me.close() };
this.char = navigator.userAgent.toLowerCase().indexOf('firefox') + 1 ?
['_', '::', '×'] : ['0', '2', 'r']; //FF不支持webdings字体
this.minbtn.innerHTML = this.char[0];
this.closebtn.innerHTML = this.char[2];
setTimeout(function () {//初始化最先位置
me.win.style.display = 'block';
me.win.style.top = me.getY().foot;
me.moveTo(me.getY().top);
}, 0);
return this;
}
};
Message.init();
</script>

},
//本方飞机
'plone':function(){
playAir.appendChild(oGame.myPlane);
var oL = playAir.offsetLeft + oGame.myPlane.offsetWidth/2;
var oT = playAir.offsetTop + oGame.myPlane.offsetHeight/2;
var oW = playAir.offsetWidth - oGame.myPlane.offsetWidth -
parseInt(getStyle(playAir,'border'))*2;
var oH = playAir.offsetHeight - oGame.myPlane.offsetHeight -
parseInt(getStyle(playAir,'border'))*2;
var x = 0;
var y = 0;
document.onkeydown = function(ev){
ev = ev || event;
if(ev.keyCode == '37'){
x-=10;
if(x<0){
x=0;
}
oGame.myPlane.style.left = x + 'px';
}
if(ev.keyCode == '38'){
y-=10;
if(y<0){
y=0;
}
oGame.myPlane.style.top = y + 'px';
}
if(ev.keyCode == '39'){
x+=10;
if(x>oW){
x=oW;
}
oGame.myPlane.style.left = x + 'px';
}
if(ev.keyCode == '40'){
y+=10;
if(y>oH){
y=oH;
}
oGame.myPlane.style.top = y + 'px';
}
if(ev.keyCode == '32'){
clearInterval(oGame.bullet.timer)
oGame.bullet(x,y);
}
}
document.onmousemove = function(ev){
ev = ev || event;
x = ev.pageX - oL;
y = ev.pageY - oT;
if(x<0){
x=0;
}else if(x > oW){
x=oW;
}
if(y<0){
y=0;
}else if(y>oH){
y=oH;
}
oGame.myPlane.style.left = x + 'px';
oGame.myPlane.style.top = y + 'px';
}
oGame.bullet.timer = setInterval(function(){
oGame.bullet(x,y)
},500)
oGame.myPlane.timer = setInterval(function(){
oGame.enemy()
},500)
},
//子弹
'bullet':function(xL,yT){
var oBullet = document.createElement('img');
oBullet.className = 'bullet';
oBullet.src='img/bullet1.png'; //飞机打出来的子弹
playAir.appendChild(oBullet)
var top = yT -oBullet.offsetHeight/2 -oBullet.offsetHeight/2 ;
oBullet.style.left = (xL - oBullet.offsetWidth/2 +
oGame.myPlane.offsetWidth/2 )+ 'px';
oBullet.style.top = top+'px';
oBullet.timer = setInterval(function(){
top-=10;
if(top<0){
clearInterval(oBullet.timer)
if(oBullet.parentNode){
oBullet.parentNode.removeChild(oBullet);
}
}
oBullet.style.top = top+'px';
},20)
},
//敌机
'enemy':function(){
var oEnemy = document.createElement('img');
oEnemy.className = 'enemy';
oEnemy.src = 'img/enemy3_fly_1.png'; //敌方的飞机
playAir.appendChild(oEnemy);
var lDistance = playAir.offsetWidth - oEnemy.offsetWidth;
var hDistance = playAir.offsetHeight - oEnemy.offsetHeight;
oEnemy.style.left = Math.random()*lDistance+'px';
var y = 0;
oEnemy.timer = setInterval(function(){
y+=10;
oEnemy.style.top = y+'px';
if(y>hDistance){
clearInterval(oEnemy.timer);
oEnemy.parentNode.removeChild(oEnemy);
}else{
//敌机撞子弹
var oBu = document.getElementsByClassName( 'bullet' );
for (var i = 0; i<oBu.length;i++) {
if(oGame.boom( oBu[i],oEnemy )){
oBu[i].parentNode.removeChild( oBu[i] );
oEnemy.src = 'img/中飞机爆炸.gif'; //敌方飞机爆炸gif图
clearInterval(oEnemy.timer);
oGame.num +=100;
document.getElementById("score").innerHTML = oGame.num;
setTimeout(function(){
if(oEnemy.parentNode){
oEnemy.parentNode.removeChild(oEnemy);
}
},500)
}
}
//敌机撞飞机
if(oGame.boom(oGame.myPlane,oEnemy)){
oGame.myPlane.src = 'img/本方飞机爆炸.gif'; //自己飞机爆炸gif图
oEnemy.src = 'img/中飞机爆炸.gif';
clearInterval(oEnemy.timer);
setTimeout(function(){
if(oEnemy.parentNode){
oEnemy.parentNode.removeChild(oEnemy);
}
if(oGame.myPlane.parentNode){
oGame.myPlane.removeChild(oGame.myPlane);
}
},500)
oGame.over();
clearInterval(oGame.myPlane.timer);
clearInterval(oGame.bullet.timer);
document.onmousemove=null;
document.onkeydown=null;
}
}
},100)
},
'boom':function(obj,obj1 ){
var l = obj.offsetLeft;
var r = l + obj.offsetWidth;
var t = obj.offsetTop;
var tt = t + obj.offsetHeight;
var l1= obj1.offsetLeft;
var r1 = l1 + obj1.offsetWidth;
var t1 = obj1.offsetTop;
var tt1 = t1 + obj1.offsetHeight;
if(l>r1 || r<l1 || t>tt1 || tt<t1){
return false;
}else{
return true;
}
},
'speed' : [
[800 , 5 , 200],
[500 , 10 , 250],
[300 , Math.random()*20 + 20 , 300],
[300 , 5, 100]
],
'score':function(){
var span = document.createElement('span');
oGame.num = 0;
span.id = 'score';
span.innerHTML = oGame.num;
playAir.appendChild(span);
},
'over':function(){
playAir.innerHTML = '';
var div = document.createElement(div);
div.id = 'box';
var btn = document.createElement('span');
btn.id = 'btn';
btn.innerHTML = '重新开始';
div.appendChild(btn);
playAir.appendChild(div);
document.getElementById("btn").onclick = oGame.init;
}
}
function getStyle( obj,attr){
return obj.currentStyle ?
obj.currentStyle[attr]:getComputedStyle(obj,false)[attr];
}
</script>
</body>
</html>

转载本站文章请注明出处:vns威尼斯城官网登入 http://www.tiec-ccpittj.com/?p=4000

上一篇:

下一篇:

相关文章