随笔分类 - js
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <!-- <script src="https://sdk.amazonaws.com/js/aws-sdk-2.410.0.
阅读全文
摘要:via raganwald.com http://raganwald.com/2014/07/09/javascript-constructor-problem.html preamble As you know, you can create new objects in JavaScript u
阅读全文
摘要:About hogan.js Hogan.js is a JavaScript templating engine for Mustache templates. Hogan is a JavaScript library that parses and compiles Mustache temp
阅读全文
摘要:http://www.cnblogs.com/pfzeng/p/4162951.html 对于JavaScript自定义事件,印象最深刻的是用jQuery在做图片懒加载的时候。给需要懒加载的图片定义一个appear事件。当页面图片开始出现时候,触发这个自定义的appear事件(注意,这里只触发一次)
阅读全文
摘要:function trims(){ this.init = function(myarguments){ if(arguments.length 0){return false;} this.arg = myarguments; this.len = this.arg.length; if(this
阅读全文
摘要:var ajaxstate=false;//定义全局变量,通过这个变量来获得当前的ajax状态$(function(){ $(document).ajaxStart(function(){ $("#Con").html("数据加载中"); }).ajaxStop(f...
阅读全文
摘要:var projector = new THREE.Projector();var world_vector = new THREE.Vector3(0,0,1);var vector = projector.projectVector(world_vector, camera);var halfW...
阅读全文
摘要:iphone6及iphone6plus已经出来一段时间了。很多移动端网站,以前写死body为320px的,现在估计也忙着做适配了。 大屏幕手机其实一直有,只是以前大家没怎么重视,移动端的H5页面大部分都以320px为基准宽度进行布局,那些大屏屌丝android用户也懒得去理,而现在iphone也搞起
阅读全文
摘要:Observe that you call obj.draw as : The first time obj.draw is called, the context is different than when it called by requestAnimationFramemultiple t
阅读全文
摘要:javascript模仿php 函数 trim ltrim rtrim,去除字符串两边空格或其他符号本文地址:js trim js php trim function trims(){ this.init = function(myarguments){ if(arguments...
阅读全文
摘要://去除字符串头尾空格或指定字符String.prototype.Trim= function(c){ if(c==null||c=="") { var str= this.replace(/^/s*/, ''); var rg = //s/; ...
阅读全文
摘要:fromHow to position the camera so that the object always has the same pixel width and height on the screen?in your case is more likely dependent on th...
阅读全文
摘要:一、Three.js基本介绍 Three.js是JavaScript编写的WebGL第三方库。提供了非常多的3D显示功能。Three.js 是一款运行在浏览器中的 3D 引擎,你可以用它创建各种三维场景,包括了摄影机、光影、材质等各种对象。你可以在它的主页上看到许多精采的演示。不过,这款引擎目前还处
阅读全文
摘要:翻译-高质量JavaScript代码书写基本要点byzhangxinxufromhttp://www.zhangxinxu.com本文地址:http://www.zhangxinxu.com/wordpress/?p=1173原文作者:Stoyan Stefanov原文链接:The Essentia...
阅读全文
摘要:1、方法定义call方法: 语法:call([thisObj[,arg1[, arg2[, [,.argN]]]]]) 定义:调用一个对象的一个方法,以另一个对象替换当前对象。 说明: call 方法可以用来代替另一个对象调用一个方法。call 方法可将一个函数的对象上下文从初始的上下文改变为由...
阅读全文
摘要:JS中的prototype是JS中比较难理解的一个部分本文基于下面几个知识点:1 原型法设计模式在.Net中可以使用clone()来实现原型法原型法的主要思想是,现在有1个类A,我想要创建一个类B,这个类是以A为原型的,并且能进行扩展。我们称B的原型为A。2 javascript的方法可以分为三类:...
阅读全文
摘要:http://zccst.iteye.com/blog/2183111 最近遇到这样一个问题,预览内容可点击,问题是通过$.Mustache.render("templateId",data)渲染后的返回结果是一个字符串。 实现方案有两个:一个是在Backbone的events中绑定事件,一个是对返
阅读全文
摘要:$("button").click(function () { $("div").each(function (index, domEle) { // domEle == this $(domEle).css("backgroundColor", "yellow"); if ($(this).is(
阅读全文
摘要:父类子类选择建筑(公建) 建筑(居住)医疗建筑 观演建筑
阅读全文

浙公网安备 33010602011771号