Ruby's Louvre

每天学习一点点算法

导航

上一页 1 ··· 105 106 107 108 109 110 111 112 113 ··· 125 下一页

2009年12月9日 #

This Week in HTML 5 – Episode 1

摘要: Web Workers, and how to specify alternate text for images you know nothing about.Welcome to a new semi-regular column, "This Week in HTML 5," where I'll try to summarize the major activity in the ongo... 阅读全文

posted @ 2009-12-09 11:05 司徒正美 阅读(857) 评论(1) 推荐(0) 编辑

Why do we have an IMG element?

摘要: I’d like to propose a new, optional HTML tag: IMG Required argument is SRC="url". This names a bitmap or pixmap file for the browser to attempt to pull over the network and interpret as an imag... 阅读全文

posted @ 2009-12-09 11:05 司徒正美 阅读(1617) 评论(1) 推荐(0) 编辑

2009年12月8日 #

返回数组中不重复的元素

摘要: 这是实现结构伪类only-of-type的部分代码: var ret= ["span","span","strong","span","b"] var norepeat = function(array){ var set = array.join(",")+","; while(array.length){ var el = array.shift(); set = set.replace(el... 阅读全文

posted @ 2009-12-08 20:31 司徒正美 阅读(2988) 评论(11) 推荐(3) 编辑

Performance and Design

摘要: Following up on Antranig’s recent post about performance, I’d like to address the issue of code design and its relationship to performance. Antranig’s article is very comprehensive a... 阅读全文

posted @ 2009-12-08 10:17 司徒正美 阅读(725) 评论(0) 推荐(0) 编辑

About this and that

摘要: This posting will be about the different styles of creating “components” or “objects” in Javascript, and which styles Fluid is planning to recommend and in what contexts. Javas... 阅读全文

posted @ 2009-12-08 10:08 司徒正美 阅读(722) 评论(0) 推荐(0) 编辑

2009年12月7日 #

(转)Google Closure: 糟糕的JavaScript

摘要: 原文:Google Closure: How not to write JavaScript 原译文地址译者注:google在2009年11月6号开源了自己在 gmail、google reader 等几乎所有重要 google 产品中使用的javascrpt : google closure ,包括一套庞大的类似与 dojo 的 library、一套与之相应的 compiler、一套 templ... 阅读全文

posted @ 2009-12-07 10:39 司徒正美 阅读(4149) 评论(4) 推荐(3) 编辑

tabIndex属性

摘要: 围绕表单的可访问性与交互性上,各浏览器都下了很大工夫,比如fieldset与legend等用于增强区域感的元素,for,accessKey,defaultValue,maxlength,tabIndex等用于交互或提示的属性。不过,今天只讲tabIndex。 tabIndex 的用处很简单,就是利用tab键遍历页面的表单元素和链接,按照tabindex的大小决定顺序。虽然微不足道,但细节处见真功夫... 阅读全文

posted @ 2009-12-07 08:55 司徒正美 阅读(16722) 评论(6) 推荐(2) 编辑

2009年12月6日 #

IE的button元素bug

摘要: button元素在过去一直没有被重视,其实它比<input type="button">的语义强许多,制定性也好许多。不过IE的button元素存在一个可怕的bug。它总是把其innerHTML神经错乱地当成其value值,因此,如果用它来提交表单时,可能产生一些负作用,会把正确的键值对覆盖了。 <!doctype html><html dir="ltr" lang=... 阅读全文

posted @ 2009-12-06 15:48 司徒正美 阅读(3330) 评论(13) 推荐(2) 编辑

聚焦时移除文本域的默认值

摘要: 为了提高软件的易用性,我们一般在文本域中填入一些样板文字,当然你也可以在旁边提示,但如果空间不足的话,就只能选择前者。当我们让文本域获得焦点时,当然要清空文本域让用户提入他们自己的内容。以下是代码,它确保文本域总有文字,不是用户填写的,就是我们的提标性文字。 function clearText(field){ if (field.defaultValue == field.value) fiel... 阅读全文

posted @ 2009-12-06 09:45 司徒正美 阅读(968) 评论(2) 推荐(2) 编辑

2009年12月4日 #

fireEvent

摘要: fireEvent可以执行已经定义好的html对象的注册事件,但不能阻止事件冒泡, <!doctype html><html dir="ltr" lang="zh-CN"> <head> <meta charset="utf-8"/> <title>IE的fireEvent By 司徒正美</title> </hea... 阅读全文

posted @ 2009-12-04 14:28 司徒正美 阅读(1284) 评论(0) 推荐(0) 编辑

上一页 1 ··· 105 106 107 108 109 110 111 112 113 ··· 125 下一页