当你的车越来越多的时候,是不是感觉车没地方停?没关系,你不是还有两个邻居嘛。。。看不到?没事。
Firefox的话是很方便,打开firebug,在控制台里输入:gotoneighbor(1);运行一下就行了。
IE的话,需要在地址栏里:javascript:gotoneighbor(1);void(); 有的需要void();,有的不需要,自己测试吧。
Submitted by gouki on 2008, September 1, 10:10 AM
当你的车越来越多的时候,是不是感觉车没地方停?没关系,你不是还有两个邻居嘛。。。看不到?没事。
Firefox的话是很方便,打开firebug,在控制台里输入:gotoneighbor(1);运行一下就行了。
IE的话,需要在地址栏里:javascript:gotoneighbor(1);void(); 有的需要void();,有的不需要,自己测试吧。
Submitted by gouki on 2008, August 31, 12:12 AM
图片的大小在不受控制的时候,我们不得不写函数来进行控制,依稀记得目前所有的jQuery图片处理函数里都有类似的函数了。但我在看到网上有人写了这个resize函数之后。不禁还是拿回来加工处理一下。以便以后随时可用。
函数如下:
用法很简单,js代码在文件头部加载后,如果遇到有图片需要缩放的,直接在<img>标签里加上:onload="resizeImage(this,300,200);"这样的代码。就可以自动缩小了。
目前并没有加上放大。
当然,我之所有转载并优化这个函数,是因为我想用在jQuery里面的。在使用jQuery的时候,必须把代码放在footer里才行。
代码如下:
放大等以后有空再写,本来想写成jQuery的插件的。可是想想好象意义不大。。。
Submitted by gouki on 2008, August 23, 9:02 AM
不多说啥了。在网上看到这篇文章,难得是有详细介绍的。。虽然这个功能我很多时候其实已经在用了,但。那都是直接拿来用的,并没有深刻的研究过。今天这里终于看到一个有注释的,就贴上来看看。
这种用法,是被YAHOO所推荐的。因为。这样的用法,降低了图片的下载量。而且并在一起,并不会给图片的大小增加很多。
原文:http://iruif.cn/swd/?p=25
这里只贴重要的内容。请原作者不要伤心。谢谢
图片文件为:
首先我们得控制好要应用小图标的对象的高度. 否则到时候这个图标就会显示异常了.
比如说我们要给 li 标签使用这个小东东, 那么我们就得写上这样的代码:
如果不明白可以问问原作者。。。
Submitted by gouki on 2008, August 21, 10:49 PM
在mootools的官方网站有一个网页专门用来测试几个框架的速度,大概是:mootools,jquery,prototype,dojo,yui,测试下来jquery的平均速度应该算是最快的。
那个评测下来IE下JS运行速度慢果然是很明显的。同样的测试在IE下面比FF下面,速度慢了一倍左右啊。
不多了。自己测试一下看结果吧。。
http://mootools.net/slickspeed/
Submitted by gouki on 2008, August 17, 10:05 AM
几天不见,YUI居然release了,虽然是preview版本。
官方这么说:
The YUI development team has issued YUI 3.0 Preview Release 1, an early look at the next generation of the Yahoo! User Interface Library (YUI). This developer preview shows you where the library is headed as we pursue goals of size, performance, consistency, power, security, and openness. You can read the introduction to the new release on YUIBlog and get a sense of the new syntactical style in this blog post, which reviews Dav Glass's Draggable Portable example — one of more than 60 examples that accompany the preview's extensive documentation. YUI 3.0 PR 1 is an early preview — not suitable for production deployment. The development team is looking forward to your feedback in the YUI 3.x community forum as we refine the API toward a 2009 release. Work continues on YUI's main 2.x codeline, too, and YUI 2.x is still the foundation for current projects. Check out the library's Roadmap for a up-to-date picture of what we're planning for upcoming releases.
有点期待。