Ruby's Louvre

每天学习一点点算法

导航

上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 125 下一页

2011年9月14日 #

IE10支持的新特性

摘要: This is a preliminary document and may be changed substantially prior to final commercial release of the software described herein.The Internet Explorer 10 Guide for Developers provides an early look at the developer features coming to the next version of Internet Explorer, as well as the latest HTM 阅读全文

posted @ 2011-09-14 20:59 司徒正美 阅读(2110) 评论(0) 推荐(0) 编辑

2011年9月13日 #

HTML5 预加载功能

摘要: HTML5对link的rel属性添加N多值,其中最有用的就是预加载功能了。它比网上提到图片预加载有时不同,它的加载时机是由浏览器决定的,只有在空闲时间才偷偷加载指定资源,防止一下子加载这么多东西把页面卡死。下面是MDC的说明Link prefetching is a browser mechanism, which utilizes browser idle time to download or prefetch documents that the user might visit in the near future. A web page provides a set of prefe 阅读全文

posted @ 2011-09-13 12:52 司徒正美 阅读(5031) 评论(4) 推荐(2) 编辑

javascript 让实例的方法都异步执行

摘要: var C = function(){ this._methodList = [];}C.prototype.fire = function(obj){ var instance = this; while(obj = this._methodList.shift()){ if(isFinite(obj.fn)){ var time = new Date; instance.timeoutID = setTimeout(function(){ instance.fire(); ... 阅读全文

posted @ 2011-09-13 10:30 司徒正美 阅读(1614) 评论(0) 推荐(0) 编辑

2011年9月11日 #

中断与停止CSS transition

摘要: 可能本来就是这样,处于阶段的CSS3就不该大规模应用,浏览器商只是用它炫耀CSS能做行为层的事儿。现在人们比对待IE的CSS滤镜宽容多了,因此这事情还是逐一被其他浏览器所接受。在CSS3提供的两上实现动画的方案中,transition与animation,animation在DOM中没有对应的API,而transition则在我们动画暂停时遇上滑铁卢了——在webkit与opera中,我们是无法用removeProperty去掉transition的效果,一经定义就永远持续下去。在firefox中,我们还可以用覆写的方式去掉它们。在开始演示之前,我给出取得CSS3 WebKitTransiti 阅读全文

posted @ 2011-09-11 11:17 司徒正美 阅读(14452) 评论(1) 推荐(0) 编辑

2011年9月7日 #

通过javascript操作CSS3属性实现动画

摘要: CSS3提供两种方式来实现动画,transition与animation。animation涉及自定义一种为“@keyframes”的东西,这个需要动用到insertRule太复杂了,因此本文跳过它。有人它为transform也算一种,但它是静态的,需要结合transition才能变成动态,因此也跳过。transition主要就是以下四个属性,后面跟着的是它们的初始值 transition-property: all; transition-duration: 0s; transition-timing-function: ease; transition-delay: 0s;trans... 阅读全文

posted @ 2011-09-07 08:52 司徒正美 阅读(8004) 评论(6) 推荐(8) 编辑

2011年9月6日 #

判定是否支持XHTML

摘要: //by 司徒正美 2011.9.6isXhtml = !!document.createElementNS('http://www.w3.org/1999/xhtml', 'div').tagName 阅读全文

posted @ 2011-09-06 23:05 司徒正美 阅读(880) 评论(1) 推荐(0) 编辑

纯javascript实现跨域通信

该文被密码保护。 阅读全文

posted @ 2011-09-06 12:49 司徒正美 阅读(6) 评论(0) 推荐(0) 编辑

2011年8月31日 #

XMLHttpRequest2

该文被密码保护。 阅读全文

posted @ 2011-08-31 10:34 司徒正美 阅读(5) 评论(0) 推荐(0) 编辑

2011年8月29日 #

mass Framework ajax模块

摘要: 由于ajax模块要涉及到后台的配合才能看到后台,因此我先给出后台代码,如果会rails的人,可以复制下来搭建相应的运行环境。控制器部分class HomeController { "aaa"=>"ruby", "bbb"=>"louvre", "ccc"=>{ "ddd"=>Time.now, "eee"=>"司徒正美" } } end format.html do render 'hom... 阅读全文

posted @ 2011-08-29 14:17 司徒正美 阅读(1384) 评论(0) 推荐(1) 编辑

2011年8月28日 #

eval, class_eval, instance_eval和binding

摘要: 前些天写html生成器的时候用到了erb,在生成html的时候是这么一句: html=tpl.result(binding)binding这个变量(Kernel的一个方法 T_T)有点古怪,就搜了下。它表示了ruby的当前作用域,没有任何对外可见的成员函数,唯一的用途就是传递给eval作第二个参数。因而可以这样:def test_binding magic='brother Chun is PURE MAN' return bindingendeval "puts magic", test_binding这样就穿越了一个作用域。有时可以见到这样的构造函数:a 阅读全文

posted @ 2011-08-28 09:29 司徒正美 阅读(2493) 评论(1) 推荐(0) 编辑

上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 125 下一页