<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PageTalks &#187; js</title>
	<atom:link href="http://pagetalks.com/tag/js/feed" rel="self" type="application/rss+xml" />
	<link>http://pagetalks.com</link>
	<description>Pure Web Development &#38; Design Ideas</description>
	<lastBuildDate>Sun, 05 Sep 2010 06:24:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>From Java to JS, and Thinking in Modern Langs</title>
		<link>http://pagetalks.com/2010/05/13/from-java-to-js-and-thinking-in-modern-langs.html</link>
		<comments>http://pagetalks.com/2010/05/13/from-java-to-js-and-thinking-in-modern-langs.html#comments</comments>
		<pubDate>Thu, 13 May 2010 07:28:33 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=392</guid>
		<description><![CDATA[有人看着标题可能就要发笑，两个完全不同的东西干嘛来放在一起比较呢？的确，本质上，Javascript（后文统称“JS”）是一种浏览器中的脚本语言，Java是更为强大的解释型语言。后者需要预先... ]]></description>
			<content:encoded><![CDATA[<p>有人看着标题可能就要发笑，两个完全不同的东西干嘛来放在一起比较呢？的确，本质上，Javascript（后文统称“JS”）是一种浏览器中的脚本语言，Java是更为强大的解释型语言。后者需要预先编译，并在自己的容器（JVM）中运行。但是仔细品味，其实两门语言的核心特性上，有太多的相似之处，不禁引人深思。借以本文，希望能给身处不同阵营的成序言一些关于语言融汇贯通的启发。</p>
<p><a href="http://pagetalks.com/wp-content/uploads/2010/05/js-vs-java.png"><img src="http://pagetalks.com/wp-content/uploads/2010/05/js-vs-java.png" alt="" title="Js vs Java" width="580" height="300" class="aligncenter size-full wp-image-394" /></a></p>
<p><span id="more-392"></span></p>
<h3>前世今天</h3>
<p>曾几何时，JS还没有多大名气的时候，Java已经非常流行了。那个时候JS的名字乱七八糟，而且每个厂商也有自己的标准。Netscape的LiveScript，MS的JScript，总之这种目前最为流行的浏览器脚本语言，在当初连个确定的名字都没有。之后，随着标准的推出，大家习惯称为Javascript。Netscape也是为了借用Java的名气，推广自己的Javascript，才取名“Java”Script的。</p>
<p>其实在几年前，Java也被运行在客户端的，大家都知道的Applet技术不就是为了客户端编程的嵌入式小程序么？可是Applet并没有火，反而这种轻量、快速的JS流行起来，一发不可收拾。虽然，Java的性能和功能都比JS强大不止一点点，JS着实是把Java赶出了浏览器，而Java则是在服务器端站稳了脚跟。</p>
<p>尽管近年来，Java Web Start、Java FX的兴起意味着在RIA的风潮下，Java还是想重回浏览器市场，但此时的浏览器客户端内，JS已经不是那个之前连名字都不确定的脚本语言了，众多的框架和调试工具已经可以让人们意识到它就是浏览器端编程的成熟标准了。</p>
<p>这样，不管是Applet还是Web Start，都已经成为了类似Adobe Flex、Adobe Air的一种针对某些特定情景的选择了。当然，业界普遍认为这些技术的前景是无限光明的。另一方面，HTML5和ECMAScript v5的推出将继续延续这种传统HTML＋CSS＋JS的RIA解决方案。</p>
<h3>数据类型</h3>
<p>JS的基础数据：Number、Boolean、null、undefined<br />
Java的基础数据：int、byte、short、long、char、float、double、boolean<br />
JS中的Number实际是Java中的double，这意味着不管数字有多大，有多少精度，都被当作double。</p>
<p>JS中没有char，也没有String？JS中没有char（JS内部的每个字符是16位的），但是有String。但JS的String，即不算作基础类型，也不能算作引用类型。JS中的String是immutable的，即不可改变。虽然可以可以通过拼接和String的相关函数进行操作，但实际上是返回一个新的结果字符串。</p>
<p>讲到这里，java程序员就疯掉了。为什么JS会有这么“粗糙”的类型系统？<br />
因为，JS是“若类型”（loose typing）。JS首先是有类型（typing）的，可是它不去检查，声明的时候也只是用var，不管你后面想申明一个Number，还是Boolean。<br />
那不是很容易出错？JS的若类型允许你把这个变量存放任何类型的东西，也就不存在出错了。</p>
<p>Java的严格类型是为了编译前检查，可JS没有编译这个步骤，自然严格类型对JS来说也就失去了很大一部分作用。</p>
<p>换个角度来看，这种弱类型是不是很轻巧呢？是的！事实上，这种轻巧的类型系统再加上各种各样的字面量，就催生了伟大的JSON。</p>
<h3>迷惑的对象系统</h3>
<p>面向对象几乎被看作当代语言的一个特性。JS显然是基于对象的，但却不能说是面向对象的。因为它没有传统的基于继承树的继承系统，也就没有所谓的父类和子类。众多宣称是“面向对象”的编程语言，严格上来说，只能算作“基于对象”。但JS有自己的继承方式，就是原型继承。</p>
<p>使用到了对象的prototype属性。这个prototype属性是JS继承机制的基础。JS对象是“直接从另一个对象那里继承”的。默认情况下，每一种数据类型都又一个指向默认原型对象的引用，即prototype属性。当你更改这个属性值的时候，意味你想让当前对象“继承”于你新指定的那个对象。如果你修改prototype中的那个对象，你是想要修改所有当前类型的对象的方法、属性。示例如下：</p>
<pre>var animal = {
    name: "general animal",
    eat: function(){
        alert(this.name + " is eating!");
    },
    sleep: function(){
        alert(this.name + " is sleeping!")
    }
}

function cat(){
    var o = function(){
    };
    o.prototype = animal;
    o.name = "cat";
    o.catchMice = function(){
        alert(this.name + " is catching mice!");
    }
    return o;
}</pre>
<p>这个其实很像GoF设计模式中模板方法，只是这个东西是内置在JS之中的，无需你再去实现一个模板机制。Java种的模板方法很常用，例如Spring的JDBC Template。<br />
尽管如此，一部分前端工程师选择了使用一种伪继承（Pseudo-Classical）的方式实现对象系统。采用这种思维，上面的那段示例应该编写如下：</p>
<pre>function Animal(){
    this.name = "general animal";
}

Animal.prototype.eat = function(){
    alert(this.name + " is eating!");
};

Animal.prototype.sleep = function(){
    alert(this.name + " is sleeping!");
};

function Cat(){
    Animal.apply(this);
    this.name = "cat";
}

Cat.prototype = new Animal();

Cat.prototype.catchMice = function(){
    alert(this.name + " is catching mice!");
}</pre>
<p>这样，程序员可以使用“new”关键字来实例化一个对象。这种方式，只是在表面上模拟传统的OOP风格，但是骨子里还是通过prototype实现了对象系统。<br />
包括Google在内的诸多厂商大量采用了这种风格，分析其原因是前端工程师大量由传统程序员转型，或者说，至少受到了传统程序语言的较大影响，并希望获得这种OOP风格。尽管，在这种风格下，大部分JS的优雅特性都泯灭了。<br />
这里，却体现出语言之间相互影响的典型案例。很多语言为了赶上OOP的风潮，都选择了OOP的风格，可是谁也说不清骨子里是否真是OOP。</p>
<h3>动态特性</h3>
<p>有趣的事情是，下面这段代码，可能让很多Java程序员迷惑：</p>
<pre>var scope = "global";
function f(){
    alert(scope);
    var scope = "local";
    alert(scope);
}</pre>
<p>Java程序员肯定会说，显示的是“global”；可是JS程序员会告诉你，显示的是“local”。这里尽管第二个scope的声明在第一个alert的后面，一个block内的var会被编译器提前到第一排，虽然此时scope还没有赋予新值。<br />
这里我想说的是，JS没有严格的块级作用域（block scoping）。正是由于JS的动态特性，以往再OOP种所提倡的“越晚用到，就越晚声明”的原则是不适用的，JS里的变量应该在每个函数的开头就全部声明。<br />
更疯狂的是，在众多的引用型数据类型里，竟然有Function？！function被看作了一种数据。</p>
<pre>var sayHello = function(){
    alert("hello world");
};</pre>
<p>这个被称为lambda函数。有人说JS是“Lisp in C’s clothing”，JS的很多特性都是有道理的。由于Java又沿用了很多C的语法特性，所以JS和Java的相似也是不奇怪的。<br />
这种lambda函数，似乎已经不是函数了，它更像pointer，可是比pointer安全、简单。</p>
<p>当你发现function是数据类型的时候，你应该能想到一个function返回另外一个function的情景。</p>
<pre>var producer = function(x){
    if (x == 1)
        return function(){
            alert("x == 1");
        };
    if (x == 2)
        return function(){
            alert("x == 2");
        };
}</pre>
<p>既然JS里Function是一种对象，那么对象有自己的属性和方法就不奇怪了。<br />
从这里，大多数Java程序员就已经疯掉了，JS的精髓所在就是这种方式所引发出的“闭包”。</p>
<h3>闭包与prototype</h3>
<p>所谓闭包，就是一个函数。但往往人们是指的一种特殊情况下的函数——即被另一个函数作为返回值所返回的函数。这个被返回的函数最大的特点就是依旧能访问原来外部函数的作用链（Scope Chain），好像原函数的那些变量都依旧存在，尽管你可能无法再显示地访问到原函数和它里面的那些变量了。<br />
JS的闭包提供一些类C语言想都想不到的功能，例如像这样实现函数的柯里化：</p>
<pre>var add = function(){
    var i, n = arguments.length, s = 0;
    for (i = 0; i < n; i++) {
        if (typeof arguments[i] == 'number' &#038;&#038; isFinite(arguments[i])) {
            s += arguments[i];
        }
    }
    return s;
};

//From Javascript the Good Parts
Function.prototype.curry = function(){
    var slice = Array.prototype.slice, args = slice.apply(arguments), that = this;
    return function(){
        return that.apply(null, args.concat(slice.apply(arguments)));
    };
};

alert(add.curry(22).curry(11)()); //prompt 33</pre>
<p>在这里，首先定义了一个add函数，它实际上接受无限个参数，并将其中的数字项目进行相加求和。</p>
<p>可最后一行没有直接调用add，并传入参数，而是执行了add的curry方法。<br />
上例中，引用了《Javascript the Good Parts》中的一个实例代码，其扩展了Function这个构造函数的prototype对象，即为每个function添加了一个curry方法。该方法维护了一个运算数的数组args，以及总是指向原函数引用的that。通过闭包的作用，通过return返回的另一个function中，that依旧持有对原函数的引用，这里that没有被垃圾收集（Garbage Collection）！</p>
<p>这里，连续调用了两次curry方法，每次都返回一个新的function对象；其args和that都持有上一个函数对象的参数和函数本身的引用，这样迭代下来，最终执行效果就是把参数收集起来，传入了add函数。</p>
<p>可见，JS的闭包则是提高JS效率，完成复杂逻辑的利器！JS工程师对自己JS的这种强大的特性十分自豪，殊不知，其实Java也有闭包。</p>
<p>Java实际很早就提供了一种内部类（InnerClass）的东西。简单的来说，在一个类体申明另外一个类体，那么里面的那个类就叫做“内部类”。大部分学习过Java的同学都知道内部类，但大多数同学应该不会想到去使用它。</p>
<p>内部类在Java中的作用是提供一种使用接口之外的多继承机制。除此之外，内部类还提供了一种和JS中的闭包一样的效果，这里我们仅说明内部类的闭包特性：</p>
<pre>public class TestClosure {

	private int number = 0;

	class Closure {
		public void increment() {
			System.out.println(number++); //More specifically, TestClosure.this.number++
		}
	}

	public Closure getCallback() {
		return new Closure();
	}

	public static void main(String[] args) {
		TestClosure tc = new TestClosure();
		Closure c = tc.getCallback();
		c.increment();
		c.increment();
		c.increment();
	}

}</pre>
<p>这里有一个名为Closure的内部类，持有了对父类的所有成员访问权。这意味着Closure内的方法，可以访问父类TestClosure中的number。Java甚至提供了一种严格的访问规则，例如number也可以用TestClosure.this.number来进行引用。<br />
上面那段代码，用JS来表现就是这样的：</p>
<pre>function TestClosure(){
    var number = 0, Closure = {};
    Closure.increment = function(){
        return number++;
    }
    return Closure;
}

var tc = TestClosure(); // Important; there is no "new" keyword here!
console.log(tc.increment());
console.log(tc.increment());
console.log(tc.increment());</pre>
<p>这里，TestClosure作为一个可以生产Closure对象的“构造函数”加工了一个Closure对象，并返回。这个Closure对象可以访问TestClosure下的任何变量或方法，自然也包括number。<br />
实际上，大量的Java闭包被用于MVC界面的编程之中，例如Swing。在未来版本的Java种，会有更强大的闭包特性。笔者在这里猜测，应该这些特性是会像JS闭包学习的。</p>
<h3>现代语言特性与人们的喜好</h3>
<p>现在市面上的变成语言层出不穷，但权威机构的月度程序语言流行度统计分析，前10名之中，C语言是最稳定的，其次是C++、Java、JS。紧接着的，ActionScript、Ruby等语言浮动性非常大。</p>
<p>可见，年龄越长的主流语言其使用度就越高，也就是更加经得起“时间的考验”。<br />
而这些“存活”下来的佼佼者，却越来越多的拥有一些共性。这就是文章讨论Java和JS两种使用环境完全不一样的语言的目的——即使环境完全不相关，这些语言的语法、风格特性都有惊人的共通之处，只是实现的方式、难以程度不大一样而已。</p>
<p>对于数据类型来说，一部分语言需要有强大的性能，那么对数据类型要尽可能的达到算法中较低的空间复杂度。这导致的是多种而全面的数据结构，伴随的可能是编译时的严格类型检查。而另一部分语言，它们的使用环境很少会要求有高强度的计算，甚至只是辅助性的，他们要求能够快速的完成开发流程、松散的维护一组数据，那么基本够用的数据类型、弱类型就可能是这个语言的基本特性了。</p>
<p>对于数据的访问，几乎大多数现代语言都使用了点访问符，区别在于访问的规则不一样。有的语言拥有块级的作用域，一组花括号（或其他界定符）之外是无法通过访问符得到花括号内部的引用的。但对于另一部分语言，你却可以设法让变量在整个程序的生命周期中被任意访问。这种灵活程度是一个语言设计中的博弈，较大的灵活程度可以得到一个轻盈、敏捷的编程风格，但是也意味着对程序员的要求也随之提高（这个在类C语言的程序员写JS的时候就很容易体现出来）。</p>
<p>由于上面所说的两个方面，数据结构的编写也会造成性能上巨大的差异。因为，同一种算法，其理论性能是确定的，但是实际性能由于实现载体不一样会造成很大的区别。人们更乐于谈论到，这种性能差异，而去忽视语言的其他差异。社区内部的一些诸如“Java还是C#”的问题就这样产生了。</p>
<p>当你仔细去观察这些已经有相应产品的编程语言，他们都是出色的，只是富有不同的特色罢了。现代语言经过用户的“自然选择”，已经进化到具有某一些通性。这种通性是我们掌握一种语言后，对其他语言的学习曲线变得更平缓。这就如同学过C语言的学生，去学习Java、C++会容易很多；学过Java、C++，去学习ActionScript也会觉得似曾相识。</p>
<p>但一种语言的存在必定拥有起特异性。这种特异性使得人们去在特定场合去使用这种语言，而放弃其他语言。例如，被大多C/C++程序员诟病的PowerScript等数据库开发的应用语言，在C/S架构下的数据库应用中仍有一席之地，特别是项目对于开发周期有较严格要求的情况下。同时，这种语言特性，也使得这种程序员很难完全掌握这门语言的全部特性。所以往往，对这些特性的掌握情况也就是衡量一名程序员对该门语言掌握程度的重要界定指标之一。</p>
<h3>结束语</h3>
<p>如今的大多数开发都逃脱不了少数几门语言。在网络应用的开发过程种，前端工程师和Java或C#程序员却俨然称为某种对立的存在。文章以JS和Java为例，从各自的语言特性出发，寻找其本质上的相同点和不同点。程序员在只有在充分了解语言与语言之间的这些特性之后，才能客观的去评价某一个语言以及更好地去驾驽自己所喜欢地语言。</p>
<h3>参考文献</h3>
<ul>
<li>《Thinking in Java》 4th Edition，P246，Using .this and .new</li>
<li>《Thinking in Java》 4th Edition，P261， Closures &#038; callbacks</li>
<li>《Javascript the Good Parts》，P52，Functional</li>
<li>《Javascript the Good Parts》，P37，Closure</li>
<li>《Javascript the Good Parts》，P43，Curry</li>
<li>《Javascript the Good Parts》，P47，Pseudoclassical</li>
<li>《Javascript the Definitive Guide》5th Edition，Prototypes and Inheritance</li>
<li>《Javascript 语言精髓》，为Javascript正名</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2010/05/13/from-java-to-js-and-thinking-in-modern-langs.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ppk on js</title>
		<link>http://pagetalks.com/2009/11/21/ppk-on-js.html</link>
		<comments>http://pagetalks.com/2009/11/21/ppk-on-js.html#comments</comments>
		<pubDate>Sat, 21 Nov 2009 09:00:05 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[ppk]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=286</guid>
		<description><![CDATA[起初听说这本书是因为淘宝UED的blog上总是在推荐这本书，最后他们甚至自己翻译了这本书。想必愿意花这么大精力在这本书上，一定又一个合理的原因──当然是这书很不错吧。 一天再逛二手... ]]></description>
			<content:encoded><![CDATA[<p>起初听说这本书是因为淘宝UED的blog上总是在推荐这本书，最后他们甚至自己翻译了这本书。想必愿意花这么大精力在这本书上，一定又一个合理的原因──当然是这书很不错吧。</p>
<p>一天再逛二手书店的时候看到了这本书，二话不说就拿下了，因为基本是4折的价格，为什么不买？</p>
<p>拿起这本书掂量了一下，这本书很注重实战。在讲解各个章节的时候，都是用实际工程中的例子来解说。和大多数老外写得书一样，总感觉废话挺多的。</p>
<p>全书的精彩部分在一开头讲JS的目标、背景以及第六章以后的零零散散的一些内容。<br />
就像作者所说的那样，书中的内容是JS所必须知道的，但远远不是JS的全部。</p>
<p>ppk是同样是世界级大师，他看问题很仔细也很有深度，大概跟他学历史有关吧;更有趣的是，他也同样会一个历史学家的眼光去看待过去浏览器大战所遗留的问题以及对未来问题的预测。但于不是专业出生，他的代码从思想上还是和那些程序员出发的人有区别的。<br />
特别是全书你不会感到一点OO的感觉，甚至也没有考虑大型工程的情况。<br />
不过我也是就书中的代码做出的推测，因为全书都是基于function，顶层对象空间也污染严重。可能他认为直接用function会很方便，也可能他觉得工程规模很小。</p>
<p>但ppk的经验是无庸置疑的，看看quirksmode就知道，毫无疑问的骨灰级人物。<br />
在书中的很多function都十分实用，你再写web应用的时候甚至可以直接copy。</p>
<p>其次ppk受《JS权威指南》的影响比较大，很多位置就是直接从那本书里搬过来的。相比看过这两本书的同学一下子就可以感觉到。</p>
<p>总体来说，这是一本很值得一读的中级JS读物。但具体应该什么时候读，我也不清楚。<br />
如果你上手JS的第一本书是《JS权威指南》恐怕这本书就只能是课外读物了。话说，多看点书绝对没有坏处，如果一定要选，读完《JS权威指南》我倒想去看看《Ajax企业开发》、《JS the Good Parts》。</p>
<p>PS　这学期原计划是深入一下JAVA的，不料被JS迷住，估计要继续研究RIA技术了。</p>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2009/11/21/ppk-on-js.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Most Wonderful Books for Web Developers and Designers</title>
		<link>http://pagetalks.com/2009/04/28/most-wonderful-books-for-web-developers-and-designers.html</link>
		<comments>http://pagetalks.com/2009/04/28/most-wonderful-books-for-web-developers-and-designers.html#comments</comments>
		<pubDate>Mon, 27 Apr 2009 17:17:16 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[Site Development]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=210</guid>
		<description><![CDATA[There are so many guides and tutorials in the bookstore. However most of them, saddly, really suck! Most authors can&#8217;t avoid the temptaion to copy words from other books. What we should do to find a really useful book is to find the root of all boo... ]]></description>
			<content:encoded><![CDATA[<p>There are so many guides and tutorials in the bookstore. However most of them, saddly, really suck!<br />
Most authors can&#8217;t avoid the temptaion to copy words from other books. What we should do to find a really useful book is to find the root of all books.<br />
Here is a simple list of the books that I&#8217;ve read ,at least partly, or I&#8217;ve bought and intended to read in the near future.</p>
<div id="books-images">PostcardViewer requires JavaScript and the Flash Player. <a href="http://www.macromedia.com/go/getflashplayer/">Get Flash here.</a></div>
<p><script type="text/javascript">
		var fo = new SWFObject("/show/postcard.swf", "viewer", "100%", "900", "8", "#ffffff");
		fo.addVariable("xmlURL", "/wp-content/uploads/2009/04/books-images.xml");					
		fo.write("books-images");	
</script>	</p>
<p><span id="more-210"></span></p>
<h3>Javascript and JQuery</h3>
<h4>JavaScript: The Good Parts</h4>
<p>It serves as a breif guide to javascript and tells us a lot of does and donts in javascript. I think it&#8217;s right the book a beginner should own.<br />
See also: http://oreilly.com/catalog/9780596517748/</p>
<h4>JavaScript: The Definitive Guide</h4>
<p>This is the bible of javascript, but definitely not a good choice for novices.<br />
See also: http://oreilly.com/catalog/9780596000486/</p>
<h4>Learning JQuery</h4>
<p>First book to talk about jQuery. It contains lots of soulutions to some typical applications with jQuery. Good for starts in jQuery.<br />
See also: http://www.packtpub.com/learning-jquery-1.3/book/mid/1802090m1d2r</p>
<h4>jQuery in Action</h4>
<p>A little deeper than the earlier. Indeed I only bought this one, and lend a copy of Learning jQuery form libarary.<br />
See also: http://www.manning.com/affiliate/idevaffiliate.php?id=648_93</p>
<h3>XHTML and CSS</h3>
<h4>Words about XHTML and CSS</h4>
<p>I don&#8217;t think we need a book to learn XHTML and CSS. First it&#8217;s very simple; Second there are comprehensive tutorials online everywhere. So I didn&#8217;t collect any books on XHTML and CSS for beginners. Following websites will be helpful: </p>
<ul>
<li>http://www.w3schools.com/</li>
<li>http://www.w3.org/</li>
</ul>
<h4>CSS Mastery: Advanced Web Standards Solutions</h4>
<p>Don&#8217;t be intimidated by the &#8216;Advanced&#8217;. It&#8217;s not only a quite praticle guide to solve lots problem, but also a starter for novice to learn css systemetically.</p>
<h4>HTML &#038; XHTML: The Definitive Guide</h4>
<p>Bibble in xhtml. Again this Definiteive Guide is not a good start for beginers.<br />
See also: http://oreilly.com/catalog/9780596527327/</p>
<h4>CSS: The Definitive Guide</h4>
<p>Bibble in css. Needn&#8217;t to tell you this is not for beginers.<br />
See also: http://oreilly.com/catalog/9780596527334/</p>
<h3>Design and User Interface</h3>
<h4>CSS Zen Garden</h4>
<p>I believe most people that can find this site own this book.<br />
See also: http://www.amazon.com/Zen-CSS-Design-Visual-Enlightenment/dp/0321303474</p>
<h4>Transcending CSS</h4>
<p>Althoght CSS is a key word in the title, this book doesn&#8217;t talk too much on CSS and turn its attention to the layout and coloring. Good for starters.<br />
See also: http://transcendingcss.com/</p>
<h4>The Principles of Beautiful Web Design</h4>
<p>A brief guide to design a beautiful web site. Good for starters.<br />
See also: http://www.sitepoint.com/books/design1/</p>
<h4>Designing Web Interfaces</h4>
<p>A really new book I just found. Haven&#8217;t read yet. Judging from the menu, it&#8217;s a good guide to master web interfaces desgin. Good for intermedia readers.<br />
See also: http://oreilly.com/catalog/9780596516253/</p>
<h4>Designing Interfaces</h4>
<p>I own this book indeed. Since we have Designing Web Interfaces which mainly focuses on web design, this book seems to be inapproximate for learning web interfaces. However most design patterns in interfaces are common, so we can still gain a lot in this book.<br />
See also: http://oreilly.com/catalog/9780596008031/</p>
<h3>JAVA</h3>
<p><b>I&#8217;d like to focus on Java Language as a solution for server-end application. So these books are mainly for Java.</b></p>
<h4>Thinking in Java</h4>
<p>I wish I had this book when I started programming. Still I ordered this book online. It&#8217;s full of examples on J2SE\Design Pattern\Common Issues and so on. Definitive introduction to java.<br />
See also: http://mindview.net/Books/TIJ4</p>
<h4>Core Servlets and JavaServer Pages</h4>
<p>Actually this is the book used in my university. It&#8217;s a good book to introduce many development artitectures from small-scale personal sites to large-scale production applications.<br />
See also: http://www.amazon.com/Core-Servlets-JavaServer-Pages-JSP/dp/0130893404</p>
<h4>Data Structures and Problem Solving Using Java</h4>
<p>Data structures are important for programing. This book provide a comprehensive introduction of data structure in JAVA5.<br />
See also: http://www.amazon.com/Data-Structures-Problem-Solving-Using/dp/0321322134</p>
<h4>Practical Apache Struts 2 Web 2.0 Projects</h4>
<p>Struts is nice and widely support by most service provider. I just bought this book, and manage to read it in my vocation.<br />
See also: http://www.apress.com/book/view/9781590599037</p>
<h4>Beginning Hibernate: From Novice to Professional</h4>
<p>Hibernate is a light framework to provide solutions for java object persistence. Although it&#8217;s pervelent in large-scale applications, it&#8217;s quite cool when you cope with your own medium-scale sites. This book is a comprehensive introduction to Hibernate. Easy to learn. Good for beginners.</p>
<h3>Database</h3>
<h4>Database Systems: Design, Implementation and Management</h4>
<p>Concepts about database and SQL. Very important for developing real application with database.<br />
See also: http://www.amazon.com/Database-Systems-Design-Implementation-Management/dp/061921323X</p>
<h4>The Definitive Guide to MySQL</h4>
<p>MySQL is the lovable database and easy to learn. This book works as a comprehensive guide to this free and powerful database system. Good for both beginners and professionals.<br />
See also: http://www.apress.com/book/view/9781590591444</p>
<h4>SQL Hacks</h4>
<p>Smart hacks for many applications. You will find insprired by these skills! I like this book very much.</p>
<p>http://oreilly.com/catalog/9780596527990/</p>
<h3>Web Sites Related</h3>
<h4>High Performance Web Sites</h4>
<p>A guide for front-end engineers. Very pratical!<br />
See also: http://oreilly.com/catalog/9780596529307/</p>
<p>To my amusement, I dream of becoming a ActionScript or Flex Develper, but I haven&#8217;t finished reading a single book on ActionScript yet! </p>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2009/04/28/most-wonderful-books-for-web-developers-and-designers.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery slideView Plugin</title>
		<link>http://pagetalks.com/2009/03/09/jquery-slideview-plugin.html</link>
		<comments>http://pagetalks.com/2009/03/09/jquery-slideview-plugin.html#comments</comments>
		<pubDate>Sun, 08 Mar 2009 22:13:17 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=203</guid>
		<description><![CDATA[Description From small-scale commercial public sites to large-scale CMS, there are needs of slideshow. Here is a simple and graceful to implement a slideshow based on a short piece of HTML Code in a both unobstructive and pleasant way. Demo Inside dev pa... ]]></description>
			<content:encoded><![CDATA[<div lang="en" class="text-en">
<h3>Description</h3>
<p>From small-scale commercial public sites to large-scale CMS, there are needs of slideshow. Here is a simple and graceful to implement a slideshow based on a short piece of HTML Code in a both unobstructive and pleasant way.</p>
<h3>Demo</h3>
<p>Inside dev pack, there are two fully functional demos.<br />
A live demo is also available on <a href="http://www.elfvision.com">http://www.elfvision.com</a>. The slide in portfolio makes use of this script.
</div>
<div lang="zh" class="text-cn">
<h3>描述</h3>
<p>小到公司的商业站点，大到文章管理系统，都会有用到幻灯片来展示图片新闻的需求。这里，我提供一种简单、优雅的幻灯片解决方案。在一小段HTML代码的基础上，能够让你无障碍并愉快地实现幻灯片效果。
</p></div>
<h3>演示</h3>
<p>在dev pack里面有两个可以运行的完整演示。在<a href="http://www.elfvision.com">http://www.elfvision.com</a>也有一个在线的演示，作品展示所用的幻灯片就是使用了该脚本。<br />
<span id="more-203"></span></p>
<div lang="en" class="text-en">
<h3>Requirements</h3>
<ul>
<li>jQuery Libary, just download from <a href="http://jquery.com/">jQuery Official Site</a></li>
<li>slideView script file. You can download it from below</li>
<li>a little knowledge on xhtml and css</li>
</ul>
<h3>Features</h3>
<p>This plugin will generate a slideview within the given container based on the data in the HTML document.</p>
<p>The slideview will consist of a group of thumbs, a navigation tool and of course the original images.</p>
<p>The main image in the slideview will change in response to the mouse movement on the thumbs and the click of navigation buttons. </p>
<p>All you have to do is prepare a set of images in porper size and the thumbnail of thoese images.</p>
<h3>Demostration</h3>
<p>Click <a href="http://pagetalks.com/share/slideView/">here</a> to see a demo page.</p>
<h3>Download</h3>
Note: There is a file embedded within this post, please visit this post to download the file.<br />
Note: There is a file embedded within this post, please visit this post to download the file.<br />
Note: There is a file embedded within this post, please visit this post to download the file.
<h3>Usage</h3>
<dl>
<dt>HTML Preparation</dt>
<dd>Just a container and an unordered list which has links to the news page or something.</p>
<pre>&lt;div id=&quot;slideshow&quot;&gt;
&lt;ul class=&quot;slideView&quot;&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/1.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/2.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/3.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/4.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/5.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/5.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</pre>
</dd>
<dt>Load jQuery Libary</dt>
<dd>You can directly add the following code in &lt;head&gt; tag：</p>
<pre>&lt;script type="text/javascript" src="jquery-1.3.2.min.js"&gt;&lt;/script&gt;</pre>
</dd>
<dt>Load slideView Plugin</dt>
<dd>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;slideview.js&#8221;&gt;&lt;/script&gt;</dd>
<dt>Assigning the target object </dt>
<dd>Use it inside jQuery(document).ready() block:</p>
<pre>$("#slideshow").slideView();</pre>
<p>You can, of course , apply some change, customizing behaviours and appearance by the means of sending parameters to the method and modifying CSS：</p>
<pre>$("#slideshow").slideView({
	thumbPrefix: "thumb_",
	frame: {
		isExist: true,
		color: "#365563"
	},
	speed: 150,
	easeOut: "swing",
	easeIn: "swing",
	easeThumb: "swing"
});</pre>
<p>Code aboce will make slideView to load thumbnails of images, whose filenames match the pattern of &#8220;thumb_image-file-name.jpg&#8221; and so on. And also, the speed of slide is 500ms.</p>
<p>Parameters avaliable in latest versions:</p>
<dl>
<dt>thumb (Boolean)</dt>
<dd>if thumbnails should be displayed</dd>
<dt>slideBy (int)</dt>
<dd>a number that tells the script how many images should pass by at one time</dd>
<dt>loop (Boolean></dt>
<dd>if it should loop automatically</dd>
<dt>interval (int)</dt>
<dd>the time interval to every loop</dd>
<dt>frame (object)</dt>
<dd>We can define a frame box overlayed on the slide:<br />
	frame.isExist (Boolean) : if it exists or not<br />
	frame.color (String) : Hex value for a color. if it exists, what color is it?
	</dd>
<dt>easeOut (String)</dt>
<dd> the easing method used when a large image slides downward</dd>
<dt>easeIn (String)</dt>
<dd>the easing method used when a large image slides upward</dd>
<dt>easeThumb (String)</dt>
<dd>the easing method used when thumbnails slide</dd>
</dl>
</dd>
</dd>
<dt>CSS Modification</dt>
<dd>By default, images in the size of 460*300 will work perfectly, however, if you&#8217;d like to use images in different size, you need alter some lines in the css. See the description in the slideview.css. You won&#8217;t miss it.</dd>
</dl>
<h3>Change Log</h3>
<p>You can always refer to <a href="http://plugins.jquery.com/project/slideview">jQuery Plugin</a> to trace the builds.</p>
<dl>
<dt>What&#8217;s new in 1.2.0</dt>
<dd>
<ul>
<li>Support auto loop</li>
<li>Fix some problems with arrows</li>
</ul>
<dt>What&#8217;s new in 1.1.0</dt>
<dd>
<ul>
<li>Beatify the UI</li>
<li>Support easing method in animation</li>
<li>Fix some strange behavious during animation</li>
</ul>
</dd>
</dl>
<ul>
<li><strong>1.1.0</strong> Third Edition</li>
<li><strong>1.1.0</strong> Second Edition</li>
<li><strong>1.0.1</strong> First Edition</li>
</ul>
</div>
<div lang="zh" class="text-cn">
<h3>需求</h3>
<ul>
<li>jQuery脚本库，你可以从 <a href="http://jquery.com/">jQuery Official官方站点</a>下载</li>
<li>slideView脚本文件</li>
<li>一点点关于xhtml,css,js的知识</li>
</ul>
<h3>功能</h3>
<p>该插件会在给定的容器内根据HTML代码生成一个幻灯片。幻灯片将会包含一组缩略图、导航工具以及原始图片。<br />
幻灯片内的主图片将会根据鼠标动作或导航工具的点击来改变。<br />
你需要做的仅仅是准备合适尺寸的图片和他们的缩略图。</p>
<h3>演示</h3>
<p>点击<a href="http://pagetalks.com/share/slideView/">这里</a>查看演示页面</p>
<h3>下载</h3>
Note: There is a file embedded within this post, please visit this post to download the file.<br />
Note: There is a file embedded within this post, please visit this post to download the file.<br />
Note: There is a file embedded within this post, please visit this post to download the file.
<h3>用法</h3>
<dl>
<dt>准备HTML代码</dt>
<dd>你仅仅需要给出一个DIV容器和一个无序列表，列表内部包含指向文章或其他内容的链接。</p>
<pre>&lt;div id=&quot;slideshow&quot;&gt;
&lt;ul class=&quot;slideView&quot;&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/1.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/2.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/3.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/4.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/5.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;lib/slideView/images/5.jpg&quot; alt=&quot;the description of image 1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</pre>
</dd>
<dt>载入jQuery库</dt>
<dd>在 &lt;head&gt; 标签内部直接添加：</p>
<pre>&lt;script type="text/javascript" src="jquery-1.3.2.min.js"&gt;&lt;/script&gt;</pre>
</dd>
<dt>加载slideView插件</dt>
<dd>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;slideview.js&#8221;&gt;&lt;/script&gt;</dd>
<dt>指定目标，并运行 </dt>
<dd>在 jQuery(document).ready() 模块中写入:</p>
<pre>$("#slideshow").slideView();</pre>
<p>你也可以通过给该方法传递参数以及修改CSS玩当来改变该插件的外观和行为：</p>
<pre>$("#slideshow").slideView({
	thumbPrefix: "thumb_",
	frame: {
		isExist: true,
		color: "#365563"
	},
	speed: 150,
	easeOut: "swing",
	easeIn: "swing",
	easeThumb: "swing"
});</pre>
<p>><br />
上面的代码将会让该插件载入符合&#8221;thumb_iamge-filename.jpg&#8221;的文件名的缩略图，并一次只滑过一张图片。滑动将在500毫秒中完成。</p>
<p>1.1.0里面的新参数:</p>
<dl>
<dt>frame (object)</dt>
<dt>slideBy (int)</dt>
<dd>一次滑过的图片张数</dd>
<dt>loop (Boolean></dt>
<dd>是否需要自动循环</dd>
<dt>interval (int)</dt>
<dd>循环时的每次切换图片的时间间隔</dd>
<dd>我们可以定义一个线条边框:<br />
	frame.isExist (Boolean) : 这个边框是否存在？<br />
	frame.color (String) : 如果存在，这里给出边框颜色的16进制值
	</dd>
<dt>easeOut (String)</dt>
<dd>当大图片向下滑动时的easing方法</dd>
<dt>easeIn (String)</dt>
<dd>当大图片向上滑动时的easing方法</dd>
<dt>easeThumb (String)</dt>
<dd>当缩略图滚动时的easing方法</dd>
</dl>
</dd>
<dt>修改CSS</dt>
<dd>默认情况下，该插件可以与460*300的容器和相应尺寸的图片完美运行。但如果你需要使用更大的图片，你就需要手动修改CSS文件了。打开slideview.css，你就明白了，仅仅是修改三个数值而已。</dd>
</dl>
<h3>更改日志</h3>
<p>你可以随时到 <a href="http://plugins.jquery.com/project/slideview">jQuery插件主页寻找更新或支持</a> .</p>
<dl>
<dt>1.2.0的新特色</dt>
<dd>
<ul>
<li>支持自动循环</li>
<li>修改了箭头的一些问题</li>
</ul>
</dd>
<dt>1.1.0的新特色</dt>
<dd>
<ul>
<li>美化了用户界面</li>
<li>在动画过程中，支持easing的修改</li>
<li>修改了动画过程中的一些奇怪先行为</li>
</ul>
</dd>
</dl>
<ul>
<li><strong>1.2.0</strong>第三个重要发行</li>
<li><strong>1.1.0</strong>第二个重要发行</li>
<li><strong>1.0.1</strong>初版</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2009/03/09/jquery-slideview-plugin.html/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Enable Thickobx in WordPress</title>
		<link>http://pagetalks.com/2008/08/29/enable-thickobx-in-wordpress.html</link>
		<comments>http://pagetalks.com/2008/08/29/enable-thickobx-in-wordpress.html#comments</comments>
		<pubDate>Fri, 29 Aug 2008 09:07:44 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=59</guid>
		<description><![CDATA[众所周知，WP2.3以后的版本其中都内置了jQuery的库，而WP2.5已在后台用了Thickbox！那么我们为何不在前台利用Thickbox来改善站点的用户交互体验呢？ 脚本在哪里？ 既然已经内置了，那么这些东西... ]]></description>
			<content:encoded><![CDATA[<p>众所周知，WP2.3以后的版本其中都内置了jQuery的库，而WP2.5已在后台用了Thickbox！那么我们为何不在前台利用Thickbox来改善站点的用户交互体验呢？</p>
<h3>脚本在哪里？</h3>
<p>既然已经内置了，那么这些东西都在哪呢？我们来查看管理页面的代码，会在HEAD部分发现如下两行：</p>
<pre>&lt;script type='text/javascript' src='http://www.elfvision.com/blog/wp-includes/js/jquery/jquery.js?ver=1.2.3'&gt;&lt;/script&gt;
&lt;script type='text/javascript' src='http://www.elfvision.com/blog/wp-includes/js/thickbox/thickbox.js?ver=3.1'&gt;&lt;/script&gt;
</pre>
<p>以上就是我们调用Thickbox所需要的脚本。如果你想使用和后台一样风格的Thickbox，可以直接引用后台中Thickbox的定义：</p>
<pre>&lt;style type='text/css' media='all'&gt;
@import 'http://www.elfvision.com/blog/wp-includes/js/thickbox/thickbox.css?1';
div#TB_title {
background-color: #222222;
color: #cfcfcf;
}
div#TB_title a, div#TB_title a:visited {
color: #cfcfcf;
}
&lt;/style&gt;</pre>
<p><span id="more-59"></span></p>
<h3>添加他们</h3>
<p>现在找到你使用的Theme下面的header.php，找到如下代码：</p>
<pre>&lt;?php wp_head(); ?&gt;</pre>
<p>在其之后添加上文找到的JS和CSS代码，这样你就可以正常地在前台页面里面调用thickbox了。当然，你可以实用Wordpress的内置函数来加入jQuery脚本。Wordpress其实已经内置jQuery的脚本库。</p>
<pre>&lt;?php wp_enqueue_script('jquery'); //Include jQuery ?&gt;</pre>
<h3>注意一些不同之处</h3>
<p>由于WP的开发小组为WP后台程序重新修改过thickobx的JS代码，所以使Thickbox的窗口有很大的不同。如果你想使用自己订制的，就不能按照上文所说的方法直接指向WP内置的相关脚本。你需要在HEADER部分链接自己的thickbox.js和thickbox.css文件。<br />
即时你使用的是WP原版的thickbox，你会发现直接调用，thickbox窗口右上角的&#8221;Close&#8221;按钮的图片无法显示。不用怀疑，绝对是相对地址所造成的问题。<br />
打开<br />
果然，我们可以找到图片都是相对引用，在不同的位置引用会造成URL错误。<br />
<code>var tb_pathToImage = "../wp-includes/js/thickbox/loadingAnimation.gif";<br />
var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";</code><br />
将他们更改为绝对地址的引用，例如：<br />
<code>var tb_pathToImage = "http://www.elfvision.com/blog/wp-includes/js/thickbox/loadingAnimation.gif";<br />
var tb_closeImage = "http://www.elfvision.com/blog/wp-includes/js/thickbox/tb-close.png";</code></p>
<p>OK，到这里，我们又榨干了WP的血。其实WP已经有Thickbox插件了，我们动手操作的意义何在？<br />
那是因为thickbox插件使用的是插件目录下的jQuery和Thickbox文件，意味着浏览者会下载双份的Js和CSS文件，无疑是浪费资源。而且，插件的jQuery文件不会随着WP的更新而更新……<br />
其实如果我有能力会编写一个在WP2.5下面，并且根据本文思路的Thickbox插件……可惜我不太会PHP，哪位有兴趣的朋友可以来试验一下。</p>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2008/08/29/enable-thickobx-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thickbox and its customization</title>
		<link>http://pagetalks.com/2008/08/29/thickbox-and-its-customization.html</link>
		<comments>http://pagetalks.com/2008/08/29/thickbox-and-its-customization.html#comments</comments>
		<pubDate>Fri, 29 Aug 2008 08:56:24 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[thickbox]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=52</guid>
		<description><![CDATA[Thickbox是基于jQuery的一套成熟的交互UI，能让设计师方便的实现Lightbox特效，以及更多你想不到的功能。 既然jQuery是一个轻量级的脚本库，作为设计师出生的使用者会感到它的使用是相对容易的... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://jquery.com/demo/thickbox/">Thickbox</a>是基于<a href="http://jquery.com/">jQuery</a>的一套成熟的交互UI，能让设计师方便的实现Lightbox特效，以及更多你想不到的功能。<br />
既然jQuery是一个轻量级的脚本库，作为设计师出生的使用者会感到它的使用是相对容易的。运用Thickbox实现Lightbox效果是目前流行的几种实现方法中最灵活、最轻便的一种。除了轻便之外，它所支持的浏览器也相当的广泛：Windows IE 6.0, Windows IE 7+, Windows FF 2.0.0.6+, Windows Opera 9.0+, Macintosh Safari 2.0.4+, Macintosh FF 2.0.0.6+, Macintosh Opera 9.10+。</p>
<h3>安装Thickbox</h3>
<p>登陆官方网站获得最新版本的<a href="http://jquery.com/">jQuery</a>和<a href="http://jquery.com/demo/thickbox/">Thickbox</a>的文件，<br />
Thickbox需要jQuery的脚本库，那么首先应该载入jQuery，再载入Thickbox了。<br />
在META标签内加入如下语句：</p>
<pre>&lt;script type="text/javascript" src="path-to-file/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="path-to-file/thickbox.js"&gt;&lt;/script&gt;</pre>
<p><span id="more-52"></span><br />
这里需要注意的是jQuery的脚本文件必须先于thickbox的脚本文件，同时注意修改文件的路径。<br />
紧接着需要加入Thickbox的CSS文件：</p>
<pre>&lt;link rel="stylesheet" href="path-to-file/thickbox.css" type="text/css" media="screen" /&gt;</pre>
<p>当然载入CSS的方法多种多样，这只是一个示范。</p>
<h3>使用Thickbox</h3>
<p>关于Thickbox的具体使用，可以参考官方网站的示例：<a href="http://jquery.com/demo/thickbox/#examples">http://jquery.com/demo/thickbox/#examples</a>也可以参考legal翻译的文档。由于原来的链接无法访问，这里只给出原文的存档：<br />
<a href="http://pagetalks.com/talks/wp-content/uploads/2008/03/thickbox/thickbox.html">http://pagetalks.com/talks/wp-content/uploads/2008/03/thickbox/thickbox.html</a></p>
<h3>定制Thickbox</h3>
<p>对于大多数实际使用中，原来的CSS文档设置的样式都无法让人满意（看看连Microsoft的官方网站上的Lightbox都那么炫）。在这里给出Thickbox中CSS档的分析：</p>
<ul>
<li>#TB_overlay：覆盖原文当背景层ID</li>
<li> .TB_overlayBG：背景层的背景元素，也就是背景的实体Class</li>
<li> #TB_window：Thickbox内容窗口的主体ID</li>
<li>#TB_caption：Thickbox内容窗口左下角的标题和导航所在DIV的ID</li>
<li>#TB_closeWindow：右上角“Close”链接所在的元素（不知道是DIV还是Span）的ID</li>
<li>#TB_closeAjaxWindow：Ajax载入窗口中的“Close”链接所在元素（不知道是DIV还是Span）的ID</li>
<li> #TB_ajaxWindowTitle：左上角标题所在元素的ID</li>
<li> #TB_title：Thickbox内容窗口顶端元素（包含标题和“Close”链接的容器）的ID</li>
<li>#TB_ajaxContent：内容容器ID</li>
<li> #TB_load：载入进度条的ID</li>
<li>#TB_iframeContent：iFrame元素ID</li>
</ul>
<p>最近在用Thickbox做ELFVision首页上的作品陈列室“Works”，可以到<a href="http://www.elfvision.com">ELFVision</a>的首页，点击Works链接看看美化过的Thickbox。不过这个是半成品，还有一些想法要通过jQuery的编程实现，慢慢来吧。</p>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2008/08/29/thickbox-and-its-customization.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
