<?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>刘钢 - 我是UED &#187; 插件</title>
	<atom:link href="http://www.iamued.com/tag/%e6%8f%92%e4%bb%b6/feed" rel="self" type="application/rss+xml" />
	<link>http://www.iamued.com</link>
	<description>http://www.IamUED.com</description>
	<lastBuildDate>Wed, 28 Jul 2010 12:58:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[原创]jQuery SimpleTip Plugin1.0</title>
		<link>http://www.iamued.com/qianduan/1144.html</link>
		<comments>http://www.iamued.com/qianduan/1144.html#comments</comments>
		<pubDate>Sun, 10 Jan 2010 12:48:12 +0000</pubDate>
		<dc:creator>RichieLiu</dc:creator>
				<category><![CDATA[JavaScript脚本]]></category>
		<category><![CDATA[前端开发]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[simpletip]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.iamued.com/?p=1144</guid>
		<description><![CDATA[公司项目由于一些历史原因 所以采用Jquery的库
一直没有用jquery的插件机制写过代码,于是就趁热打铁研究了一下jq的插件机制
非常简单的一个效果 暂且命名为jQuery SimpleTip Plugin1.0吧
[查看DEMO] [下载源码]
插件功能很简单：见下图

就是一个鼠标提示的tip效果 可以自定义宽度
使用方法：
在需要使用该插件的页面插入如下依赖 具体路径请自行修改
分别是：JQuery1.32 本插件核心代码 和本插件的css样式

&#60;script src=&#34;jquery/jquery-1.3.2.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
&#60;script src=&#34;simpletip/jquery.tip-min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
&#60;link href=&#34;simpletip/SimpleTip.css&#34; rel=&#34;stylesheet&#34;/&#62;

插件使用：

$(document).ready(function(){//jq的页面载入事件
    $(&#34;#tip2&#34;).tip({ //获取目标元素
    width: 100,//自定义宽度 也可以不设定此项
    text: &#34;&#60;span class='icon01'&#62;&#60;/span&#62;宽度：100px 是自定义的&#34;//提示内容 可以包含html代码
    });
})

核心代码分析：


(function($){//建立闭包
	var _tip;//创建提示对象
    $.fn.tip = function(options){//jq插件机制的核心函数$.fn
        var defaults [...]]]></description>
			<content:encoded><![CDATA[<p>公司项目由于一些历史原因 所以采用Jquery的库<br />
一直没有用jquery的插件机制写过代码,于是就趁热打铁研究了一下jq的插件机制<br />
非常简单的一个效果 暂且命名为<a href="http://www.iamued.com/demo/simpletip/index.html">jQuery SimpleTip Plugin1.0</a>吧<br />
<a href="http://www.iamued.com/demo/simpletip/index.html">[查看DEMO]</a> <a href="http://www.iamued.com/demo/simpletip/simpletip_iamued.rar">[下载源码]</a><br />
插件功能很简单：见下图<br />
<img class="alignnone size-full wp-image-1145" title="tip1" src="http://www.iamued.com/wp-content/uploads/2010/01/tip1.jpg" alt="tip1" width="168" height="88" /><br />
就是一个鼠标提示的tip效果 可以自定义宽度</p>
<p><strong>使用方法：</strong><br />
在需要使用该插件的页面插入如下依赖 具体路径请自行修改<br />
分别是：JQuery1.32 本插件核心代码 和本插件的css样式</p>
<pre class="brush: xml;">
&lt;script src=&quot;jquery/jquery-1.3.2.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;simpletip/jquery.tip-min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;simpletip/SimpleTip.css&quot; rel=&quot;stylesheet&quot;/&gt;
</pre>
<p><strong>插件使用：</strong></p>
<pre class="brush: jscript;">
$(document).ready(function(){//jq的页面载入事件
    $(&quot;#tip2&quot;).tip({ //获取目标元素
    width: 100,//自定义宽度 也可以不设定此项
    text: &quot;&lt;span class='icon01'&gt;&lt;/span&gt;宽度：100px 是自定义的&quot;//提示内容 可以包含html代码
    });
})
</pre>
<p><strong>核心代码分析：</strong><br />
<span id="more-1144"></span></p>
<pre class="brush: jscript;">
(function($){//建立闭包
	var _tip;//创建提示对象
    $.fn.tip = function(options){//jq插件机制的核心函数$.fn
        var defaults = {	//默认参数
			width:300,
            text: &quot;这里是提示文字&quot;
        };
        var opts = $.extend(defaults, options);//参数合并 具体参见jq手册
        this.bind(&quot;mouseover&quot;, function(event){//给目标对象绑定事件
            showtip(event, opts);
        });
        this.bind(&quot;mouseout&quot;, function(event){
            _tip.hide();
        });
        this.css(&quot;cursor&quot;, &quot;pointer&quot;);//目标对象的鼠标样式
    };
    function showtip(event, opts){//显示提示层方法
        target = $(event.target);//获取事件触发的对象
        if (!_tip) {//如果提示对象不存在
            _tip = $(&quot;&lt;div/&gt;&quot;);//创建一个div element
            _tip.addClass(&quot;tip&quot;).css(&quot;width&quot;, opts.width).appendTo($(&quot;body&quot;));//根据参数设定宽度 插入到body中
            _tip.bind(&quot;mouseenter&quot;, function(event){//给提示对象绑定事件 这里使用mouseenter jq已经做了兼容
                $(this).show();
            });
            _tip.bind(&quot;mouseleave&quot;, function(event){//给提示对象绑定事件 这里使用mouseleave jq已经做了兼容
                $(this).hide();
            });
        }
        _tip.css(&quot;width&quot;, opts.width);//提示对象的宽度
        _tip.html(&quot;&lt;div&gt;&quot;+opts.text+&quot;&lt;/div&gt;&quot;);//提示对象的内容
        _tip.append($(&quot;&lt;iframe class='ie6iframe'&gt;&lt;/iframe&gt;&quot;).css(&quot;width&quot;, _tip.width()).css(&quot;height&quot;, _tip.outerHeight(true)));
		//建立遮罩层
        _tip.css(&quot;position&quot;, &quot;absolute&quot;).css(&quot;top&quot;,target.offset().top + target.height() - 3).css(&quot;left&quot;,target.offset().left);//提示对象定位
        _tip.show();
    };
    })(jQuery);
</pre>
<p>就到这里吧：）<br />
<a href="http://www.iamued.com/demo/simpletip/index.html">[查看DEMO]</a> <a href="http://www.iamued.com/demo/simpletip/simpletip_iamued.rar">[下载源码]</a><br />
转载请注明来源：）</p>
<h2  class="related_post_title">您可能还关注的？</h2><ul class="related_post"><li><a href="http://www.iamued.com/qianduan/1506.html" title="微软的jQuery国际化插件">微软的jQuery国际化插件</a></li><li><a href="http://www.iamued.com/qianduan/1401.html" title="即拷即用：onDOMReady（提取自jQuery.ready）">即拷即用：onDOMReady（提取自jQuery.ready）</a></li><li><a href="http://www.iamued.com/qianduan/1328.html" title="jQuery源码查看器">jQuery源码查看器</a></li><li><a href="http://www.iamued.com/qianduan/1182.html" title="[译]jQuery 1.4 发布：15个新特性实例精讲">[译]jQuery 1.4 发布：15个新特性实例精讲</a></li><li><a href="http://www.iamued.com/qianduan/1180.html" title="Jquery1.4正式版发布了 JS库时代就是这样快">Jquery1.4正式版发布了 JS库时代就是这样快</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.iamued.com/qianduan/1144.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Firefox非主流开发扩展推荐</title>
		<link>http://www.iamued.com/qianduan/760.html</link>
		<comments>http://www.iamued.com/qianduan/760.html#comments</comments>
		<pubDate>Tue, 15 Dec 2009 02:05:22 +0000</pubDate>
		<dc:creator>RichieLiu</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[页面实现]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[扩展]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.iamued.com/?p=760</guid>
		<description><![CDATA[
Firebug已经家喻户晓，不必多说。下面推荐的是些村酒野蔬，虽没什么名气，但其味醇厚甜美，食之飘香再难忘情。
HTML Validator

http://users.skynet.be/mgueury/mozilla/
很喜欢这个扩展的Tidy算法模式，可以检查出HTML页面中绝大部分嵌套和书写错误，并且针对每个错误都有详细的说明和推荐写法。当然，很多时候，我们不大可能去纠正所有错误和警告。一个常用的小技巧是：将可以容忍的错误添加到Hidden列表中。这样，只要看看右下角的状态信息，就知道页面中是否还有错误了。

Launchy

https://addons.mozilla.org/en-US/firefox/addon/81
这个扩展相见恨晚，一见就再也离不开了。如上图所示，能很方便的让我们在不同浏览器中加载测试页面，还可以配置编辑器。注意的是：默认情况下，Launchy会自动探测浏览器和编辑器，我的习惯是将自动探测关闭，按照选项里的说明，在chrome目录下通过launchy.xml手动指定菜单项。这是我的配置文件：Firefoxprofilechromelaunchy.xml. 目前IETester只能打开，不知道怎么传送参数过去，还希望知道的指点一下。（IETester 0.3已经支持Command line arguments）
Fiddler Switch

https://addons.mozilla.org/en-US/firefox/addon/9373
在前端开发界，有这么一个说法：Firefox + Firebug + Fiddler，称之为 3F，拯救了前端的工作。Fiddler是个伟大的工具，默认在IE上工作得挺好，但在Firefox上需要设置代理，有点麻烦，Fiddler Switch就是Taobao UED空帷达人为了解决此问题而开发的。如果你还没用过Fiddler，推荐阅读下这篇文章：如何直接调试线上页面的JavaScript和CSS。
Johnny Cache

https://addons.mozilla.org/en-US/firefox/addon/3817
是否厌倦了 Ctrl + F5? 是否有时忘了切换 Web Developer Toolbar 禁用的Cache，而导致上网很慢？Johnny Cache让你一次配置，永久解决烦恼。我很喜欢这种谦虚却非常实用的扩展。
Firefox DNS Flusher

https://addons.mozilla.org/en-US/firefox/addon/7408
这也是一款非常谦虚但绝对实用的扩展。开发测试时，经常要修改hosts文件。但默认情况下，Firefox会缓存DNS，修改hosts文件后，有时得重启Firefox才能生效，这是很让人恼火的。装了这个扩展，就再也不用等待漫长的重启了。同时，还拥有了一个附加功能：直接查看域名的ip.
MeasureIt

https://addons.mozilla.org/en-US/firefox/addon/539
根据mockup制作精确的demo是前端工程师们的日常工作，通常的做法是在Photoshop或其它图像处理软件中测量，但来回切换窗口是有点影响效率的。MeasureIt能让你直接在页面中的测量，方便快捷。
我的Firefox上，除了Firebug, 开发用的扩展就上面这些了。除了MeasureIt用的频率不是很多，其它扩展几乎天天都用。感谢这些扩展，让我有更多的时间好好生活。
转自http://lifesinger.org/blog/2009/01/firefox-non-mainstream-addons/

您可能还关注的？[原创]jQuery SimpleTip Plugin1.0]]></description>
			<content:encoded><![CDATA[<div>
<p>Firebug已经家喻户晓，不必多说。下面推荐的是些村酒野蔬，虽没什么名气，但其味醇厚甜美，食之飘香再难忘情。</p>
<h3>HTML Validator</h3>
<p><img title="html_validator" src="http://lifesinger.org/blog/wp-content/uploads/2009/01/html_validator.png" alt="html_validator" width="212" height="76" /><br />
<a href="http://users.skynet.be/mgueury/mozilla/">http://users.skynet.be/mgueury/mozilla/</a></p>
<p>很喜欢这个扩展的Tidy算法模式，可以检查出HTML页面中绝大部分嵌套和书写错误，并且针对每个错误都有详细的说明和推荐写法。当然，很多时候，我们不大可能去纠正所有错误和警告。一个常用的小技巧是：将可以容忍的错误添加到Hidden列表中。这样，只要看看右下角的状态信息，就知道页面中是否还有错误了。<br />
<span id="more-760"></span></p>
<h3>Launchy</h3>
<p><img title="launchy" src="http://lifesinger.org/blog/wp-content/uploads/2009/01/launchy.png" alt="launchy" width="451" height="245" /><br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/81">https://addons.mozilla.org/en-US/firefox/addon/81</a></p>
<p>这个扩展相见恨晚，一见就再也离不开了。如上图所示，能很方便的让我们在不同浏览器中加载测试页面，还可以配置编辑器。注意的是：默认情况下，Launchy会自动探测浏览器和编辑器，我的习惯是将自动探测关闭，按照选项里的说明，在chrome目录下通过launchy.xml手动指定菜单项。这是我的配置文件：<a href="http://lifesinger.org/blog/wp-content/uploads/2009/01/launchy.xml">Firefoxprofilechromelaunchy.xml</a>. <del datetime="2009-02-16T08:56:55+00:00">目前IETester只能打开，不知道怎么传送参数过去，还希望知道的指点一下。</del>（IETester 0.3已经支持Command line arguments）</p>
<h3>Fiddler Switch</h3>
<p><img title="fiddler_switch" src="http://lifesinger.org/blog/wp-content/uploads/2009/01/fiddler_switch.png" alt="fiddler_switch" width="264" height="69" /><br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/9373">https://addons.mozilla.org/en-US/firefox/addon/9373</a></p>
<p>在前端开发界，有这么一个说法：Firefox + Firebug + Fiddler，称之为 3F，拯救了前端的工作。Fiddler是个伟大的工具，默认在IE上工作得挺好，但在Firefox上需要设置代理，有点麻烦，Fiddler Switch就是Taobao UED空帷达人为了解决此问题而开发的。如果你还没用过Fiddler，推荐阅读下这篇文章：<a href="http://lifesinger.org/blog/?p=40">如何直接调试线上页面的JavaScript和CSS</a>。</p>
<h3>Johnny Cache</h3>
<p><img title="johnnycache" src="http://lifesinger.org/blog/wp-content/uploads/2009/01/johnnycache.png" alt="johnnycache" width="312" height="209" /><br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/3817">https://addons.mozilla.org/en-US/firefox/addon/3817</a></p>
<p>是否厌倦了 Ctrl + F5? 是否有时忘了切换 Web Developer Toolbar 禁用的Cache，而导致上网很慢？Johnny Cache让你一次配置，永久解决烦恼。我很喜欢这种谦虚却非常实用的扩展。</p>
<h3>Firefox DNS Flusher</h3>
<p><img title="dns_flusher" src="http://lifesinger.org/blog/wp-content/uploads/2009/01/dns_flusher.png" alt="dns_flusher" width="279" height="63" /><br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/7408">https://addons.mozilla.org/en-US/firefox/addon/7408</a></p>
<p>这也是一款非常谦虚但绝对实用的扩展。开发测试时，经常要修改hosts文件。但默认情况下，Firefox会缓存DNS，修改hosts文件后，有时得重启Firefox才能生效，这是很让人恼火的。装了这个扩展，就再也不用等待漫长的重启了。同时，还拥有了一个附加功能：直接查看域名的ip.</p>
<h3>MeasureIt</h3>
<p><img title="measureit" src="http://lifesinger.org/blog/wp-content/uploads/2009/01/measureit.png" alt="measureit" width="373" height="98" /><br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/539">https://addons.mozilla.org/en-US/firefox/addon/539</a></p>
<p>根据mockup制作精确的demo是前端工程师们的日常工作，通常的做法是在Photoshop或其它图像处理软件中测量，但来回切换窗口是有点影响效率的。MeasureIt能让你直接在页面中的测量，方便快捷。</p>
<p>我的Firefox上，除了Firebug, 开发用的扩展就上面这些了。除了MeasureIt用的频率不是很多，其它扩展几乎天天都用。感谢这些扩展，让我有更多的时间好好生活。<br />
转自<a href="http://lifesinger.org/blog/2009/01/firefox-non-mainstream-addons/">http://lifesinger.org/blog/2009/01/firefox-non-mainstream-addons/</a></p>
</div>
<h2  class="related_post_title">您可能还关注的？</h2><ul class="related_post"><li><a href="http://www.iamued.com/qianduan/1144.html" title="[原创]jQuery SimpleTip Plugin1.0">[原创]jQuery SimpleTip Plugin1.0</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.iamued.com/qianduan/760.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
