Category Archives: Skill | 技术

My Second Life.

text-shadow在chrome for windows下的“辛”路历程

Posted in Skill | 技术 | Leave a comment

为什么 CSS 选择器是从右往左的?

很多人可能都知道了 CSS 的选择器浏览器在解析的时候是从右往左的,和你所熟悉的从左往右的规则是不同的。但是这是为什么呢?这么做的性能是否更高? Related Items: 为什么排版引擎解析 CSS 选择器时一定要从右往左解析?

Posted in Skill | 技术 | 4 Comments

野比のび太あなごの頭

New Nobita Anago avatar, by @iiiCyan. 最近很流行的鳗鱼头像,最早先是看到了重光同学 @lucifierya 的坂田银时的鳗鱼头像。 鳗鱼作者是 @daijingogo。以及官方出品的鳗鱼头像制作器 http://anago.crap.jp/ 另外还有One Piece的鳗鱼头像 http://youkocleo.exteen.com/ Have fun!

Posted in Skill | 技术 | 5 Comments

a snippet for testing whether you could visit twtter or facebook

Some of you guys like add “Twitter button” or “Facebook Like button” on your website. But if your visitor from china that don’t use VPN or anyother jailbreak the G-F-W tools, it will slow down the page load until the … Continue reading

Posted in Skill | 技术 | 13 Comments

匹配一段文本中URL的正则问题

在项目中有个这样的设计,备注中的URL自动识别为点击的链接,对此的处理方式是用正则匹配出URL部分,然后替换成<a href=URL>URL这样即可。其主要部分是正则匹配出URL部分。 假设有这么一段文本。 你好,我是一段文本。我链接到http://leeiio.me/test.html请大家多多指教。 那么我们可以这么写。 var text = "你好,我是一段文本。我链接到http://leeiio.me/test.html请大家多多指教。"; var regexp = /((http|ftp|https|file):\/\/([\w\-]+\.)+[\w\-]+(\/[\w\-\.\/?\@\%\!\&=\+\~\:\#\;\,]*)?)/ig; text = text.replace(regexp,"<a href=’$1′>$1</a>"); console.log(text);var text = "你好,我是一段文本。我链接到http://leeiio.me/test.html请大家多多指教。"; var regexp = /((http|ftp|https|file):\/\/([\w\-]+\.)+[\w\-]+(\/[\w\-\.\/?\@\%\!\&=\+\~\:\#\;\,]*)?)/ig; text = text.replace(regexp,"<a href=’$1′>$1</a>"); console.log(text); 但是如果URL中带有中文,那么以上的就不顶事了。

Posted in Skill | 技术 | 12 Comments

Link

The Difference Between jQuery’s .bind(), .live(), and .delegate()

西方不够好的朋友可以看这篇译文《jQuery的.bind()、.live()和.delegate()之间的区别》。这篇文章详细的比较了bind(),live()以及delegate()的区别。以及作者为什么推荐用delegate()。

Posted in Skill | 技术 | 3 Comments