自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(42)
  • 收藏
  • 关注

转载 CSS3选择器,详细归纳一下,算是一个工作总结

1基本选择器* p #hi .hi 2层次选择器 div p body>div .active+div .active~div 3伪类选择器:  动态伪类选择器 :link :visited :hover :active :focus  目标伪类选择器 :target  语言伪类选择器  UI伪类...

2015-11-25 21:11:00 92

转载 浏览器缓存机制

http://blog.csdn.net/longxibendi/article/details/41630389可放到文件,内存中(如session),还有cache(高速缓存),还有 cookie,session,viewstate,这些是我们经常用到的,但可以认为他们是缓存数据。其实cache跟session有相似功能,但 cache可在代码中设置过期时间,依赖项。...

2015-11-25 20:54:00 96

转载 雅虎

CSS3有哪些新特性? CSS3实现圆角(border-radius:8px),阴影(box-shadow:10px), 对文字加特效(text-shadow、),线性渐变(gradient),旋转(transform) transform:rotate(9deg) scale(0.85,0.90) translate(0px,-30px) skew(-9deg,0deg);//...

2015-11-25 13:16:00 144

转载 Doctype作用,标准模式与兼容模式的区别

<!DOCTYPE>声明位于位于HTML文档中的第一行,处于 <html> 标签之前。告知浏览器的解析器用什么文档标准解析这个文档。DOCTYPE不存在或格式不正确会导致文档以兼容模式呈现。标准模式的排版 和JS运作模式都是以该浏览器支持的最高标准运行。在兼容模式中,页面以宽松的向后兼容的方式显示,模拟老式浏览器的行为以防止站点无法工作。HTML5 ...

2015-11-25 11:14:00 634

转载 事件代理delegation

当我们需要对很多元素添加事件的时候,可以通过将事件添加到它们的父节点而将事件委托给父节点来触发处理函数。这主要得益于浏览器的事件冒泡机制。转载于:https://www.cnblogs.com/sunhe/p/4989756.html...

2015-11-23 21:29:00 79

转载 block-level elements 和 inline elements

块级元素:div form table p h ol ul内联元素:span a input select textarea imgblock元素可以包含block元素和inline元素,但inline元素只能包含inline元素display:inline-block简单来说就是将对象呈现为inline对象,但是对象的内容作为block对象呈现。...

2015-11-23 18:28:00 128

转载 行内元素和块级元素

1、块级元素:div p h form ul li ol2、行内元素:span img input textarea label a3、可变元素:button iframe块级元素:独占一行,宽度自动填满父元素宽度行内元素:不会独占一行转载于:https://www.cnblogs.com/sunhe/p/4989239.html...

2015-11-23 18:11:00 65

转载 面向对象编程,走迷宫

建立maze.js, mazespace.js, robot.js界面逻辑写在robotmazeinterface.js"use strict";//maze.jsfunction Maze(width,height){ this.width=width; this.height=height; this.startX ...

2015-07-09 14:52:00 150

转载 面向对象编程

function Question(text,choices,answer){//question.js this.text=text; this.choices=choices; this.answer=answer;}Question.prototype.isCorrectAnswer=function(choice){ return this.ans...

2015-07-09 10:11:00 89

转载 原型继承3

function Media(title,duration) { this.title=title; this.duration=duration; this.isPlaying=false;}Media.prototype.play = function() { this.isPlaying=true;};Media.prototype.st...

2015-07-08 21:35:00 56

转载 原型继承2

function Dice(sides){ this.sides=sides; this.roll=function(){ var randomNumber=Math.floor(Math.random()*this.sides)+1; return randomNumber; }}var dice=new Dice(6);  fu...

2015-07-08 21:14:00 58

转载 js面向对象编程,原型继承1

var dice={   sides:6,  roll:function(){     var randomNumber=Math.floor(Math.random()*this.sides)+1;//this的用法     return randomNumber;   }}var button=document.getElementById("button");but...

2015-07-08 17:57:00 64

转载 js面向对象编程3

requirejs.config({  paths:{    jquery:"jquery-1.11.1.min"  }})requirejs(['jquery','backtop'],function($,backtop){  new backtop.BackTop($('#backTop'),{    mode:'move',    pos...

2015-07-08 16:53:00 53

转载 js面向对象编程2

定义BackTop,引用scrolltodefine(['jquery','scrollto'],function($,scrollto){  function BackTop(el,opts){//定义构造函数    this.opts=$.extend({},BackTop.DEFAULTS,opts);    this.$el=$(el);    this...

2015-07-08 16:49:00 85

转载 js面向对象编程1

首先,关注jquery的两个方法,$.extend({},ScrollTo.DEFAULTS,opts),如果用户输入opts就用opts,否则用默认值ScrollTo.DEFAULTS$.proxy(this._move,this))重定向指针,this指向this对象实例而不是当前点击元素//定义基本对象ScrollTodefine(['jquery'],fu...

2015-07-08 16:33:00 77

转载 require,js 在项目中的应用

<script src="js/require.js" data-main="js/main"></script>//main.jsrequirejs.config({ paths:{ jquery:'jquery-1.11.1' } })requirejs(['jquery','backtop']...

2015-07-06 15:24:00 94

转载 scss 在mac下编译

sass --watch style.scss  转载于:https://www.cnblogs.com/sunhe/p/4622904.html

2015-07-05 20:10:00 274

转载 require.js 应用实例

//引入require.js<script src="js/require.js" data-main="js/main"></script>//main.js定义别名requirejs.config({ paths:{ jquery:'jquery-1.11.1.min' }})//main.js 引入...

2015-07-05 20:00:00 118

转载 js 定义构造函数

var Timeline=function(){this.order=[];this.add=function(timeout,func,log){ this.order.push({ timeout:timeout, func:func, log:log })};this.start=functio...

2015-07-05 13:58:00 99

转载 CSS3 transition animation 在动画上的应用

@-webkit-keyframes rock{0%{transform:rotate(0deg);}10%{transform:rotate(3deg);}20%{transform:rotate(-3deg);}30%{transform:rotate(2deg);}40%{transform:rotate(-2deg);}50%{transform:ro...

2015-07-05 13:40:00 53

转载 dom 元素操作 增删改

//获取网页宽高var sHeight=document.documentElement.scrollHeight;var sWidth=document.documentElement.scrollWidth;//获取可视区域宽高var wHeight=document.documentElement.clientHeight;var wWidth=do...

2015-07-05 11:51:00 82

转载 backbone TodoList

文档结构:index.htmltodos.cssdestroy.pngtodos.js../backbone.localStorage.js../../backbone.js../../test/vendor/jquery.js../../test/vendor/json2.js../../test/vendor/underscore.js转...

2015-05-18 22:03:00 101

转载 前端技术栈

require.js for dependency management and modular code模块化代码,依赖管理 backbone.js for basic application strcture and separation of concerns 应用架构,分成设计marionette.js for composite application archi...

2015-05-18 21:56:00 64

转载 微信内,第三方网站获得用户信息

1、得到codehttps://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8888888888888888&redirect_uri=http://mascot.duapp.com/oauth2.php&response_type=code&scope=snsapi_userinfo&am...

2015-05-06 16:31:00 67

转载 官方文档reactJS实例,最终版

var CommentBox = React.createClass({ loadCommentsFromServer: function() { $.ajax({ url: this.props.url, dataType: 'json', success: function(data) { this.se...

2015-03-25 18:18:00 94

转载 React.js 官方文档翻译3 代码集合

<html> <head> <title>Hello React</title> <script src="https://fb.me/react-0.13.1.js"></script> <script src="https://fb.me/JSXTransformer...

2015-03-25 18:09:00 90

转载 React.js 官方文档翻译2

Component PropertiesNow that we have defined theCommentcomponent, we will want to pass it the author name and comment text. This allows us to reuse the same code for each unique comment. Now ...

2015-03-24 17:43:00 272

转载 React简介

A Quick Introduction to ReactReact is, according to their own definition, “A Javascript library for building user interfaces.” When I first read aboutreact, it immediately struck me as a very ...

2015-03-24 16:39:00 91

转载 React.js 官方文档翻译

Your first componentReact is all about modular, composable components. For our comment box example, we'll have the following component structure:你的第一个组件React全部是是关于模块化、可组装的组件的。对于我们的评论框例子,我们需...

2015-03-24 16:24:00 98

转载 网购避孕套

充气娃娃转载于:https://www.cnblogs.com/sunhe/p/4354400.html

2015-03-20 19:14:00 102

转载 作用域链 The Scope Chain

JavaScript is a lexically scoped language: the scope of a variable can be thought of asthe set of source code lines for which the variable is defined. Global variables are definedthroughout the p...

2015-03-19 18:19:00 85

转载 New JavaScript techniques for rapid page loads 加快页面载入的新js技术

Speed has always been one of Chrome's primary missions, ever since it was included as one of the founding principles in 2008. But speed is about more than just traditional Javascript benchmarks. ...

2015-03-19 17:12:00 122

转载 jQuery 文档翻译 .on()

.on( events [, selector ] [, data ], handler )Description:Attach an event handler function for one or more events to the selected elements.绑定一个事件处理函数到选定元素The.on()method attaches event...

2015-03-19 16:41:00 51

转载 jQuery最佳实践

1. 使用最新版本的jQuery2. 用对选择器(1)最快的选择器:id选择器和元素标签选择器3. 理解子元素和父元素的关系4. 不要过度使用jQuery5. 做好缓存6. 使用链式写法7. 事件的委托处理(Event Delegation)。javascript的事件模型,采用"冒泡"模式,也就是说,子元素的事件会逐级向上"冒泡",成为父元素的事件。因为td元素...

2015-03-19 16:04:00 72

转载 jQuery的基本设计思想和主要用法

选择某个网页元素,然后对其进行某种操作  $(document) //选择整个文档对象  $('#myId') //选择ID为myId的网页元素  $('div.myClass') // 选择class为myClass的div元素  $('input[name=first]') // 选择name属性等于first的input元素  $('a:first') //选择网页中...

2015-03-19 15:38:00 47

转载 jQuery的deferred对象

deferred对象的多种方法 (1)$.Deferred()生成一个deferred对象。  (2)deferred.done()指定操作成功时的回调函数  (3)deferred.fail()指定操作失败时的回调函数  (4)deferred.promise()没有参数时,返回一个新的deferred对象,该对象的运行状态无法被改变;接受参数...

2015-03-19 14:34:00 44

转载 Javascript异步编程 Asynchronous JS: Callbacks, Listeners, Control Flow Libs and Promises

Javascript语言的执行环境是"单线程"(single thread)一次只能完成一件任务。如果有多个任务,就必须排队,前面一个任务完成,再执行后面一个任务Javascript语言将任务的执行模式分成两种:同步(Synchronous)和异步(Asynchronous)"异步模式"则完全不同,每一个任务有一个或多个回调函数(callback),前一个任务结束后,不...

2015-03-19 14:25:00 88

转载 程序员大保健

教人写代码转载于:https://www.cnblogs.com/sunhe/p/4350051.html

2015-03-19 12:37:00 167

转载 try/catch/finally

The try/catch/finally statement is JavaScript’s exception handling mechanism.try/catch/finally语句是js的异常处理机制。Thetry clause of this statement simply defines the block of code whose exceptions...

2015-03-18 15:27:00 71

转载 JSON

JSON parsing and stringificationJSON解析与字符串化JSON is a simple object that serves as the namespace for the global ECMAScript 5 functionsJSON.parse() and JSON.stringify().JSON is not a constru...

2015-03-18 15:16:00 69

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除