![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
lusizhifei
这个作者很懒,什么都没留下…
展开
-
吸顶菜单
Document *{margin:0 auto;} p{height:2000px;} div{width:900px;height:500px;background:gold;} #nav{overflow:hidden;background:#333;height:60px;margin:0 auto;width:900px;} li{float:left;list-style原创 2017-02-16 17:36:49 · 783 阅读 · 0 评论 -
原声JS放大镜
放大镜 *{margin: 0;padding: 0;} #box{width: 400px;height: 400px;border: 1px solid #ccc;position: relative;left: 50px;top: 50px;} #cover{width: 400px;height: 400px;position:absolute;left: 0;top:0;bac原创 2017-03-02 17:09:00 · 286 阅读 · 0 评论 -
飞机大战游戏
飞机大战 * {margin: 0;padding: 0;} #container { width: 320px; height: 568px; position: absolute; top:0; left: 0; right: 0; bottom: 0; margin: auto; overflow: hidden; } #start { width:原创 2017-03-10 17:01:44 · 289 阅读 · 0 评论 -
原声JS生成包括数字和字母的验证码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script type="text/javascript"> var str =原创 2017-03-15 17:40:11 · 315 阅读 · 0 评论 -
选项卡切换图片
选项卡切换图片 *{margin:0;padding:0;} #tab{margin:20px auto;width:500px;height:auto;} ul{width:500px;height:40px;background:#f3f1f1;line-height:40px;border:1px solid #d5d1d1;} ul li{float:left;list原创 2017-02-20 20:01:45 · 587 阅读 · 0 评论 -
元素只能在固定窗口内拖动
Document *{margin:0;padding:0;} #box{width:400px;height:400px;border:1px solid #ccc;position:relative;margin:300px auto;} #cont{width:60px;height:60px;background:pink;position:absolute;}原创 2017-02-21 19:44:56 · 716 阅读 · 0 评论 -
封装DOM查找元素方法
东方原创 2017-02-20 19:09:53 · 510 阅读 · 0 评论 -
封装获取某个元素指定css属性值的方法
封装style /*#demo{width:200px;height:300px;}*/ 阿萨德股份大概 --> //var Demo=$('#demo'); //getComputedStyle() IE9之前不支持此方法 //console.log(getComputedStyle(Demo).width); //currentS原创 2017-02-20 19:44:52 · 1493 阅读 · 0 评论 -
洗扑克牌
洗扑克牌 开始洗牌 var tem=['红桃','黑桃','方块','梅花']; var gam=['A','2','3','4','5','6','7','8','9','10','J','Q','K'] var big=['小王','大王']; var coll=[]; var all=[]; var Btn1=document.getElementById(原创 2017-02-20 19:54:53 · 361 阅读 · 0 评论 -
随机点名
随机点名 #p1{ position: absolute; width: 300px; height: 200px; border:5px solid #eee; top: 20px; left:10px; font-size: 88px; font-weight: bold; font-family: "微软雅黑"; line-height: 200px; text-原创 2017-02-20 19:56:56 · 371 阅读 · 0 评论 -
猜数字游戏
猜数字游戏 猜数字游戏 var answer=Math.ceil(Math.random()*100); var Btn1=document.getElementById('btn1'); var count=0; Btn1.onclick=function sum(){ var n=Number(prompt('请输入你猜的数字')); count++;原创 2017-02-20 19:58:53 · 320 阅读 · 0 评论 -
下载进度条
下载进度条 h2{color:#ccc;font-size:12px;height:20px;} p{width:1px;height:20px;background:red;position:absolute;left:0;top:-16px;z-index:1;} div{width:500px;height:20px;background:#ccc;position:absolut原创 2017-02-20 20:00:05 · 242 阅读 · 0 评论 -
轮播图
轮播图 *{margin:0;padding:0;} #content{width:400px;height:400px;border:10px solid #ccc;margin:40px auto;position:relative;background:#f1f1f1;} #content a{width:40px;height:40px;background:#000;borde原创 2017-02-20 20:00:40 · 367 阅读 · 0 评论 -
模拟购物车
模拟购物车 h2{width:400px;height:20px;color:#600} div{border:1px solid #ccc;width:400px;margin:0 auto;height:auto;background:linear-gradient(to left,#fff,#CF9,#fff,#CF9,#CF6);} table{border:1px solid原创 2017-02-20 20:03:07 · 257 阅读 · 0 评论 -
限定移动范围--teacher
Document #container { width: 800px; height: 600px; position: absolute; top:10px; left: 150px; background: gray; } #box { width: 100px; height: 100px; background: red; position: abso原创 2017-02-21 21:09:12 · 376 阅读 · 0 评论