07 2015 档案

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