摘要: 绝对定位,三列的div,用float(浮动)来做是不行的,要用到绝对定位绝对定位:positi:absolute;贴紧左上边:position: absolute;left: 0;top: 0;贴紧右上边:position: absolute;right: 0;top: 0;left(左边距离)ri 阅读全文
posted @ 2020-05-11 21:36 丶玲珑骰子安红豆 阅读(240) 评论(0) 推荐(0)
摘要: // 100元购物卡,牙刷5元,香皂两元,洗发水15元,100元正好花完有多少种可能// var j = 0;// for(var x=0;x<=20;x++){// for(var y=0;y<=50;y++){// for(var z=0;z<=6;z++){// if(5*x+2*y+15*6 阅读全文
posted @ 2020-05-10 19:58 丶玲珑骰子安红豆 阅读(313) 评论(0) 推荐(0)
摘要: // 猜拳游戏// 做一个跟计算机猜拳的小游戏。0-剪刀,1-石头,2-布// 要求输出0,1,2,计算机生成随机数,与人类输入的相比较判断谁胜了。// 随机数生成:var rom = parseInt(Math.random()*3);var rom = parseInt(Math.random( 阅读全文
posted @ 2020-05-10 16:21 丶玲珑骰子安红豆 阅读(437) 评论(0) 推荐(0)
摘要: // 三元运算符 // var i = 10; // i %=6; // var y = i++; // console.log(y) // p(180,70) // p(190,40) // p(170,90) // function p(i,w){ // // var i = parseInt( 阅读全文
posted @ 2020-05-10 13:41 丶玲珑骰子安红豆 阅读(578) 评论(0) 推荐(0)
摘要: // window.onscroll事件(Y一定是大写) window.onscroll = function() { console.log(scrollY); if (scrollY > 800) { document.getElementById('ret').style.display = 阅读全文
posted @ 2020-05-08 22:30 丶玲珑骰子安红豆 阅读(145) 评论(0) 推荐(0)
摘要: setInterval(function(){},1000)定时器; clearInterval()取消定时器; setTimeout(function(){},1000); 定时器的日期 var myVar=setInterval(function(){myTimer()},1000); func 阅读全文
posted @ 2020-05-06 16:45 丶玲珑骰子安红豆 阅读(223) 评论(0) 推荐(0)
摘要: 查找元素 方法:document.getElementById()=$(‘#id’)、 document.getElementsByTagName()=$(‘div’)、 document.getElementsByClassName()=$(‘.class’); 改变元素 document.get 阅读全文
posted @ 2020-04-29 16:30 丶玲珑骰子安红豆 阅读(119) 评论(0) 推荐(0)
摘要: // /递归 // function b(a){ // if(a==1){ // return 2; // } // else{ // return 2*b(a-1) // } // } // 波非那契数列 // function bb(n){ // if(n<=2){ // return 1; / 阅读全文
posted @ 2020-04-27 16:18 丶玲珑骰子安红豆 阅读(137) 评论(0) 推荐(0)
摘要: // 匿名函数 // 使用匿名函数表达式时,函数的调用语句,必须放在函数声明语句之后 // var n = function(){ // console.log('匿名函数') // } // n(); // 自执行函数 // !function(h){ // console.log('自执行函数' 阅读全文
posted @ 2020-04-26 16:50 丶玲珑骰子安红豆 阅读(94) 评论(0) 推荐(0)
摘要: // var b = (i<=c && i>n)// &&(如果有一个假的就是假的) // var c = (i<=c || i>n)// ||(如果有一个真的就是真的) // var d = !true; // !(加上就是假的) // console.log(d) // true?console 阅读全文
posted @ 2020-04-25 16:57 丶玲珑骰子安红豆 阅读(93) 评论(0) 推荐(0)