<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>防W8系统屏保</title> <script>
(JS={
$:function(o){return typeof o=="string"?document.getElementById(o):o},
dingwei:false,
shubiao:0,
weizhi:0,
on:function(o,type,fn){o.attachEvent?o.attachEvent('on'+type,function(){fn.call(o)}):o.addEventListener(type,fn,false);return JS.on}, fn1:function(o,attr){
e= arguments.callee.caller.arguments[0]||window.event;
var b=e.clientY this.shubiao=b;
this.dingwei=true;
this.weizhi=parseInt(o.style[attr]) clearInterval(o["ll"])
}, fn2:function(o,attr){
if(this.dingwei){
var d= arguments.callee.caller.arguments[0]||window.event;
var dd=d.clientY-this.shubiao;
var cc=this.weizhi+dd;
if( dd<=0){
o.style[attr]=cc+"px"
}
}
}, fn3:function(o,attr){
this.dingwei=false;
var gg=parseInt(o.style[attr]);
clearInterval(o["ll"]);
if(gg<-300)
{
o["ll"]=setInterval(function(){ gg-=5; o.style[attr]=gg+"px"; if(gg<-(screen.height)){
clearInterval(o["ll"])
}
},10)
}
else if(gg>=-300&&gg<-5){
o["ll"]=setInterval(function(){ gg+=5; o.style[attr]=gg+"px"; if(gg>=-5){
clearInterval(o["ll"])
}
},10)
}
}, }).on(window,"load",function(){
var Q=JS.$("bb");
JS.on(Q,"mousedown", function(){ JS.fn1(Q,"top")})
(Q,"mousemove",function(){ JS.fn2(Q,"top")})
(Q,"mouseup",function(){JS.fn3(Q,"top")})
(Q,"mouseout",function(){JS.fn3(Q,"top")})
}) </script>
</head>
<body>
<div id="bb" style=" position:absolute; top:0px; left:0px; width:100%;height:100%; cursor:pointer; background-color:#06F;">
</div>
</body></html>

面向对象:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head> <script type="text/javascript">
function WP8(id){
var $this=this;
this.kongzhi=false;
this.cY1=null;
this.cY2=null;
this.weizhi=null;
this.oid=document.getElementById(id);
this.oid.onmousedown=function(e){var e=e||window.event; $this.cY1=e.clientY;$this.fn1()};
this.oid.onmousemove=function(e){var e=e||window.event; $this.cY2=e.clientY;$this.fn2()};
this.oid.onmouseup=function(){$this.fn3()};
this.oid.onmouseout=function(){$this.fn3()};
}; WP8.prototype.fn1=function(){
this.kongzhi=true;
this.weizhi=parseInt(this.oid.style["top"]);
}; WP8.prototype.fn2=function(){
if(this.kongzhi&&(this.cY2-this.cY1)<0){
this.oid.style["top"]=this.weizhi+(this.cY2-this.cY1)+"px";
} }; WP8.prototype.fn3=function(){
this.kongzhi=false;
var this1=this
var gg=parseInt(this.oid.style["top"]);
clearInterval(this['qingchu']);
if(gg<-300){ this['qingchu']=setInterval(function(){
gg-=5;
this1.oid.style["top"]=gg+"px"; if(gg<-(screen.height)){clearInterval(this1['qingchu']);} },10) } else if(gg>=-300&&gg<-5){
this['qingch']=setInterval(function(){ gg+=5;
this1.oid.style["top"]=gg+"px"; if(gg>=0){clearInterval(this1['qingch']);}
},10 ) } }; window.onload=function(){ new WP8("bb")
}
</script>
<body> <div id="bb" style=" position:absolute; top:0px; left:0px; width:100%;height:100%; cursor:pointer; background-color:#06F;"> </div>
</body>
</html>

仿W8屏保的更多相关文章

  1. 一个仿windows泡泡屏保的实现

    一个仿windows泡泡屏保的实现 有天看到有人在百度知道上问windows 泡泡屏保该怎么用C#做,一时有趣,就做了一个出来,对于其中几个要点总结如下: 一,屏保程序的制作要求 屏保程序的扩展名是. ...

  2. C#制作简易屏保

    前言:前段时间,有个网友问我C#制作屏保的问题,我瞬间懵逼了(C#还可以制作屏保!).于是我去查阅相关资料,下面把C#如何制作屏保的过程及我学习过程的心得也记录下来,希望对需要的人能有帮助. 基本思路 ...

  3. Linux关闭休眠和屏保模式

    本人因为特殊需求,想让某台Linux主机始终显示某个程序,显示器不能关机或者休眠或进入屏保模式. 环境:Ubuntu 11.10 最小化模式安装并安装有轻量级桌面openbox(非gnome).因为X ...

  4. [AIR] AS3.0设置屏保功能

    package com.controls { import flash.desktop.NativeApplication; import flash.events.Event; import fla ...

  5. Win XP 如何禁用屏保

    如果你试过 “在桌面空白处点击右键-[属性]-[屏幕保护程序],选择[无],点击[确定]”后,当时是可以去掉屏保.但如果重启计算机或者从待机状态唤醒后,屏保依然会出现,那么你可以试试下面的方法. 首先 ...

  6. wpf 制作播放视频的屏保程序、而且能分屏显示

    这个程序用到了WPF里  “visual_Brush”(主要是为了实现分屏显示) , “UserControl” ,这两个知识点: 在屏保状态下播放指定文件夹下的视频,而且能分屏显示: 把编译好的屏保 ...

  7. C#制作简易屏保(转)

    C#制作简易屏保[原创] 原始网址: http://www.cnblogs.com/drizzlecrj/archive/2006/10/06/522182.html 2006-10-06 16:25 ...

  8. python写的屏保程序

    __author__ = 'ChenYan' from random import randint from tkinter import * class Randball(): def __init ...

  9. Android - Daydream 互动屏保

    Android Daydream 互动屏保 API19 API23 Create:2016-03-01 继承DreamService来实现一个自定义屏保 Dreams是当充电的设备空闲,或者插入底座时 ...

随机推荐

  1. DataTable插件指定某列不可排序

    datatable是一个jQuery扩展的表格插件.其提供了强大的表格功能. 官方地址:http://www.datatables.NET/ DataTable提供的表格样式里面,第一行都是会有排序功 ...

  2. java中filter的用法 内部资料 请勿转载 谢谢合作

    filter过滤器主要使用于前台向后台传递数据是的过滤操作.程度很简单就不说明了,直接给几个已经写好的代码: 一.使浏览器不缓存页面的过滤器 Java代码   import javax.servlet ...

  3. wf(六)

    前面我们都是通过WorkflowInvoker这个类来调用方法的,这种方式是很简单的,因为这是同步的而且同样的调用者调用工作流使用的线程是一样的. 另外一个调用工作流的方法是通过工作流应用程序类(Wo ...

  4. Instant Complexity - POJ1472

    Instant Complexity Time Limit: 1000MS Memory Limit: 10000K Description Analyzing the run-time comple ...

  5. jQuery validation学习(1)验证只输入空格通过验证

    当input输入了空格是不会提示信息的 一般会去除空格然后进行验证 这个时候就要添加onkeyup事件去除左侧的空格 验证只输入空格通过验证 //添加验证手机方法 jQuery.validator.a ...

  6. MySql binlog恢复数据

    1. 直接导入数据库 mysqlbinlog --database=testdb mysql-bin. | mysql -uroot -f 2. 导出成SQL文 (1) 从binlog输出为SQL m ...

  7. 【前端】CoffeeScript

    es6中的双箭头函数可以省略小括号,coffee中不可以 es6: (x) => x * x // 可以 x => x * x // 可以 coffee: (x) => x * x ...

  8. 分享自己的超轻量级高性能ORM数据访问框架Deft

    Deft 简介 Deft是一个超轻量级高性能O/R mapping数据访问框架,简单易用,几分钟即可上手. Deft包含如下但不限于此的特点: 1.按照Transact-SQL的语法语义风格来设计,只 ...

  9. 23-React Render Element

    第23节 React Render Element 1.Element 元素是反应应用程序的最小积木. 元素描述你在屏幕上看到的内容.: const element= <h1>你好,世界& ...

  10. ACM HDU 2041--超级楼梯题解

    超级楼梯 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submis ...