07 2015 档案
摘要:建立maze.js, mazespace.js, robot.js界面逻辑写在robotmazeinterface.js"use strict";//maze.jsfunction Maze(width,height){ this.width=width; this.height=hei...
阅读全文
摘要:function Question(text,choices,answer){//question.js this.text=text; this.choices=choices; this.answer=answer;}Question.prototype.isCorrectAnswer=func...
阅读全文
摘要:function Media(title,duration) { this.title=title; this.duration=duration; this.isPlaying=false;}Media.prototype.play = function() { this.isPlaying=tr...
阅读全文
摘要:function Dice(sides){ this.sides=sides; this.roll=function(){ var randomNumber=Math.floor(Math.random()*this.sides)+1; return randomNumber; }}var di...
阅读全文
摘要:var dice={ sides:6, roll:function(){ var randomNumber=Math.floor(Math.random()*this.sides)+1;//this的用法 return randomNumber; }}var b...
阅读全文
摘要:requirejs.config({ paths:{ jquery:"jquery-1.11.1.min" }})requirejs(['jquery','backtop'],function($,backtop){ new backtop.BackTop($('#backTop'),{...
阅读全文
摘要:定义BackTop,引用scrolltodefine(['jquery','scrollto'],function($,scrollto){ function BackTop(el,opts){//定义构造函数 this.opts=$.extend({},BackTop.DEFAULTS,o...
阅读全文
摘要:首先,关注jquery的两个方法,$.extend({},ScrollTo.DEFAULTS,opts),如果用户输入opts就用opts,否则用默认值ScrollTo.DEFAULTS$.proxy(this._move,this))重定向指针,this指向this对象实例而不是当前点击元素//定...
阅读全文
摘要://main.jsrequirejs.config({ paths:{ jquery:'jquery-1.11.1' } })requirejs(['jquery','backtop'],function($,backtop){ $('#backTop').backtop({...
阅读全文
摘要://引入require.js//main.js定义别名requirejs.config({ paths:{ jquery:'jquery-1.11.1.min' }})//main.js 引入模块requirejs(['jquery','validate'],function($,val...
阅读全文
摘要:var Timeline=function(){this.order=[];this.add=function(timeout,func,log){ this.order.push({ timeout:timeout, func:func, log:log ...
阅读全文
摘要:@-webkit-keyframes rock{0%{transform:rotate(0deg);}10%{transform:rotate(3deg);}20%{transform:rotate(-3deg);}30%{transform:rotate(2deg);}40%{transform:...
阅读全文
摘要://获取网页宽高var sHeight=document.documentElement.scrollHeight;var sWidth=document.documentElement.scrollWidth;//获取可视区域宽高var wHeight=document.documentEleme...
阅读全文

浙公网安备 33010602011771号