※御殿屋日式家庭料理※
地址:台北市松山區南京東路5段255號2樓(清心樓上)
電話:(02)27605615
時間:18:00~22:00(例假日公休)
9/24/2008
应用: text-overflow:ellipsis; white-space:nowrap; overflow:hidden; 实现了溢出文本显示省略号效果
应用: text-overflow:ellipsis; white-space:nowrap; overflow:hidden; 实现了溢出文本显示省略号效果 - 設定 text-overflow:ellipsis之前要先有overflow:hidden,不然內文一樣會溢出,text-overflow:ellipsis FF2不支援,ie6支援(!!),chrom/webkit支援。使用text-overflow:ellipsis的另外一個好處是不會有字從一半cut調的情形。
http://chunghe.googlecode.com/svn/trunk/experiment/text-overflow.htm
语法:
text-overflow : clip | ellipsis
参数:
clip : 不显示省略标记(...),而是简单的裁切
(clip这个参数是不常用的!)
ellipsis : 当对象内文本溢出时显示省略标记(...)
http://chunghe.googlecode.com/svn/trunk/experiment/text-overflow.htm
9/19/2008
IE7-/Win problems with absolute inside relative position
在position:relative裡面的position:absolute如果有對不準的情形,在position:relative的element加上zoom:1通常可解。
IE7-/Win problems with absolute inside relative position
http://chunghe.googlecode.com/svn/trunk/experiment/ie.abolute.position.bug/index.htm
IE7-/Win problems with absolute inside relative position
http://chunghe.googlecode.com/svn/trunk/experiment/ie.abolute.position.bug/index.htm
9/18/2008
REST, I just don't get it
RESTful best practices
REST, I just don't get it
REST, I just don't get it
Read the comments for some excellent practical reasons to care about REST, including cache management (PUT and DELETE can expire the cache entries for the corresponding GET), the ability to add or move parts of the server API without redeploying client libraries and the idempotency of GET / PUT / DELETE and HEAD (repeated POST operations may have side-effects).
json-tinyurl
json-tinyurl
http://tinyurl.com/api-create.php?url=http://json-tinyurl.appspot.com/
http://tinyurl.com/api-create.php?url=http://json-tinyurl.appspot.com/
Because sometimes you want to be able to create a shorter version of a URL directly from JavaScript without hosting your own server-side proxy.
Design Elements - V8 JavaScript Engine - Google Code
Design Elements - V8 JavaScript Engine - Google Code
High level design details of Google’s V8 JavaScript engine, including how it uses “hidden classes” to optimise object property lookups and a bit of information on the machine code generation and garbage collection.
Google's undocumented favicon to png convertor
Google's undocumented favicon to png convertor -

http://www.google.com/s2/favicons?domain=www.wretch.ccShowing the favicon of a domain next to a link is a really nice trick, but it’s slightly tricky to achieve as IE won’t display a .ico file if you link to it from an img element, so you need to convert the images server-side. This undocumented Google API does that for you, meaning it’s much easier to add favicons as a feature to your site.
9/16/2008
10 Principles of the CSS Masters - NETTUTS
10 Principles of the CSS Masters - NETTUTS
2. Keep CSS declarations in one line - Jonathan Snook -

4. Allow block elements to fill space naturally - Jonathan Snook
2. Keep CSS declarations in one line - Jonathan Snook -

4. Allow block elements to fill space naturally - Jonathan Snook
My rule of thumb is, if I set a width, I don't set margin or padding. Likewise, if I'm setting a margin or padding, I don't set a width. Dealing with the box model can be such a pain, especially if you're dealing with percentages. Therefore, I set the width on the containers and then set margin and padding on the elements within them. Everything usually turns out swimmingly.
Downshift Your Code » Yahoo! User Interface Blog
Downshift Your Code » Yahoo! User Interface Blog
As a concrete example, consider the resize event. In most browsers, the resize event fires after the user has finished resizing the window, meaning that the event is fired once for each window resize. Internet Explorer, on the other hand, fires the resize event continuously as the user is resizing the browser. If you have anything more than some simple calculations being applied during onresize, it’s possible to end up confusing IE by having too much going on (especially if the event handler does any UI manipulations). The solution is to throttle your code so that a method is called a maximum number of times per second. This can be achieved using timeouts and a little bit of indirection. The basic pattern is as follows:
As a concrete example, consider the resize event. In most browsers, the resize event fires after the user has finished resizing the window, meaning that the event is fired once for each window resize. Internet Explorer, on the other hand, fires the resize event continuously as the user is resizing the browser. If you have anything more than some simple calculations being applied during onresize, it’s possible to end up confusing IE by having too much going on (especially if the event handler does any UI manipulations). The solution is to throttle your code so that a method is called a maximum number of times per second. This can be achieved using timeouts and a little bit of indirection. The basic pattern is as follows:
YAHOO.namespace("example");
YAHOO.example.MyObject = {
_timeoutId : 0,
_process : function () {
//processing code goes here
},
process : function () {
clearTimeout(this._timeoutId);
var me = this;
this._timeoutId = setTimeout(function(){
me._process();
}, 250);
}
};
Writing Efficient CSS - MDC
Writing Efficient CSS - MDC
Avoid Universal Rules!
Don't qualify ID-categorized rules with tag names or classes
If you have a style rule that has an ID selector as its key selector, don't bother also adding the tag name to the rule. IDs are unique, so you're slowing down the matching for no real reason.
Don't qualify class-categorized rules with tag names
Similar to the rule above, all of our classes will be unique. The convention you should use is to include the tag name in the class name.
Try to put rules into the most specific category you can!
The single biggest cause of slowdown in our system is that we have too many rules in the tag category. By adding classes to our elements, we can further subdivide these rules into class categories, and then we no longer waste time trying to match as many rules for a given tag.
Rely on inheritance!
Learn which properties inherit, and allow them to do so! We have explicitly set up XUL widgetry so that you can put list-style-image (just one example) or font rules on the parent tag, and it will filter in to the anonymous content. You don't have to waste time writing a rule that talks directly to the anonymous content.
Avoid Universal Rules!
Don't qualify ID-categorized rules with tag names or classes
If you have a style rule that has an ID selector as its key selector, don't bother also adding the tag name to the rule. IDs are unique, so you're slowing down the matching for no real reason.
* BAD - button#backButton { }
* BAD - .menu-left#newMenuIcon { }
* GOOD - #backButton { }
* GOOD - #newMenuIcon { }
Don't qualify class-categorized rules with tag names
Similar to the rule above, all of our classes will be unique. The convention you should use is to include the tag name in the class name.
* BAD - treecell.indented { }
* GOOD - .treecell-indented { }
Try to put rules into the most specific category you can!
The single biggest cause of slowdown in our system is that we have too many rules in the tag category. By adding classes to our elements, we can further subdivide these rules into class categories, and then we no longer waste time trying to match as many rules for a given tag.
* BAD - treeitem[mailfolder="true"] > treerow > treecell { }
* GOOD - .treecell-mailfolder { }
Rely on inheritance!
Learn which properties inherit, and allow them to do so! We have explicitly set up XUL widgetry so that you can put list-style-image (just one example) or font rules on the parent tag, and it will filter in to the anonymous content. You don't have to waste time writing a rule that talks directly to the anonymous content.
* BAD - #bookmarkMenuItem > .menu-left { list-style-image: url(blah); }
* GOOD - #bookmarkMenuItem { list-style-image: url(blah); }
High Performance Ajax Applications
High Performance Ajax Applications
If you have control over where your code is going to be inserted in the page, write your init code in a <script> block located right before the closing </body> tag.
Otherwise, use the YUI Event utility’s onDOMReady method
Memoization:
Module pattern
Store value in function object
Lazy function definition
Running CPU Intensive JavaScript Computations in a Web Browser
demo
Julien Lecomte’s Blog » The Problem With innerHTML
If you have control over where your code is going to be inserted in the page, write your init code in a <script> block located right before the closing </body> tag.
Otherwise, use the YUI Event utility’s onDOMReady method
Memoization:
Module pattern
var fn = (function () {
var b = false, v;
return function () {
if (!b) {
v = ...;
b = true;
}
return v;
};
})();
Store value in function object
function fn () {
if (!fn.b) {
fn.v = ...;
fn.b = true;
}
return fn.v;
}
Lazy function definition
var fn = function () {
var v = ...;
return (fn = function () {
return v;
})();
};
Running CPU Intensive JavaScript Computations in a Web Browser
demo
Julien Lecomte’s Blog » The Problem With innerHTML
YAHOO.util.Dom.setInnerHTML = function (el, html) {
el = YAHOO.util.Dom.get(el);
if (!el || typeof html !== 'string') {
return null;
}
// Break circular references.
(function (o) {
var a = o.attributes, i, l, n, c;
if (a) {
l = a.length;
for (i = 0; i < l; i += 1) {
n = a[i].name;
if (typeof o[n] === 'function') {
o[n] = null;
}
}
}
a = o.childNodes;
if (a) {
l = a.length;
for (i = 0; i < l; i += 1) {
c = o.childNodes[i];
// Purge child nodes.
arguments.callee(c);
// Removes all listeners attached to the element via YUI's addListener.
YAHOO.util.Event.purgeElement(c);
}
}
})(el);
// Remove scripts from HTML string, and set innerHTML property
el.innerHTML = html.replace(/
