魔鬼甄與天使嘉 - 《食記》無招牌無菜單御殿屋
※御殿屋日式家庭料理※
地址:台北市松山區南京東路5段255號2樓(清心樓上)
電話:(02)27605615
時間:18:00~22:00(例假日公休)
应用: text-overflow:ellipsis; white-space:nowrap; overflow:hidden; 实现了溢出文本显示省略号效果 - 設定 text-overflow:ellipsis之前要先有overflow:hidden,不然內文一樣會溢出,text-overflow:ellipsis FF2不支援,ie6支援(!!),chrom/webkit支援。使用text-overflow:ellipsis的另外一個好處是不會有字從一半cut調的情形。
语法:
text-overflow : clip | ellipsis
参数:
clip : 不显示省略标记(...),而是简单的裁切
(clip这个参数是不常用的!)
ellipsis : 当对象内文本溢出时显示省略标记(...)
在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
RESTful best practices
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
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
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 - http://www.google.com/s2/favicons?domain=www.wretch.cc
Showing 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.
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
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
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
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 { }
* BAD - treecell.indented { }
* GOOD - .treecell-indented { }
* BAD - treeitem[mailfolder="true"] > treerow > treecell { }
* GOOD - .treecell-mailfolder { }
* BAD - #bookmarkMenuItem > .menu-left { list-style-image: url(blah); }
* GOOD - #bookmarkMenuItem { list-style-image: url(blah); }
標籤: CSS
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
var fn = (function () {
var b = false, v;
return function () {
if (!b) {
v = ...;
b = true;
}
return v;
};
})();
function fn () {
if (!fn.b) {
fn.v = ...;
fn.b = true;
}
return fn.v;
}
var fn = function () {
var v = ...;
return (fn = function () {
return v;
})();
};
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(/