<?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>等待-放飞梦想 &#187; hover</title>
	<atom:link href="http://leotheme.cn/tag/hover/feed" rel="self" type="application/rss+xml" />
	<link>http://leotheme.cn</link>
	<description>勤现在-乐将来</description>
	<lastBuildDate>Fri, 03 Feb 2012 12:32:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jQuery实现背景图渐变切换</title>
		<link>http://leotheme.cn/javascript/jquery-dragoninteractive-navi.html</link>
		<comments>http://leotheme.cn/javascript/jquery-dragoninteractive-navi.html#comments</comments>
		<pubDate>Fri, 28 Aug 2009 15:07:54 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[切换]]></category>
		<category><![CDATA[背景]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=728</guid>
		<description><![CDATA[链接的背景图切换一般都用CSS的HOVER来控制，虽然很方便，但效果不怎么酷，没有平滑效果，显得有点突然。在这篇文章里给大家介绍下如何用jQuery来实现一个平滑的渐变式背景切换。效果大家可以看下这个站（http://dragoninteractive.com/）。如图所示。 上面的网站在中有很多地方都应用了这种效果。看起来是不是很酷。OK，进入正题； 在这里我用一个简单的实例来分析下，先看下我们要用到的这张图。 我们把背景切换的两张图做成一张。这样的好处我以前也有说过了。详见“CSS中关于背景图的应用技巧”；接下来要做的是写结构和样式部分。 body { margin: 0; padding: 0; text-align: center; }&#160;&#160; &#160;#logo { &#160;&#160; &#160; &#160; &#160; &#160; &#160;position: absolute;&#160;&#160; &#160; &#160; &#160; &#160; &#160;display: block;&#160;&#160; &#160; &#160; &#160; &#160; &#160;width: 156px;&#160;&#160; &#160; &#160; &#160; &#160; &#160;height: 49px;&#160;&#160; &#160; &#160; &#160; &#160; &#160;/*这部分是让元素相对浏览器垂直居中&#160;&#160; &#160; &#160; &#160; &#160; &#160;left: 50%;&#160;&#160; &#160; &#160; &#160; &#160; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery中queue和dequeue的用法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery中queue和dequeue的用法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jQuery实现个性有序列表" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-to-sequential-list.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197275.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jQuery实现个性有序列表</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jquery写一个简单的菜单伸缩效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-for-nav-slide.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197279.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jquery写一个简单的菜单伸缩效果</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 实现 tab 切换一例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-tab.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197250.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 实现 tab 切换一例</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="一个jQuery弹出层(tipsWindown)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindown.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">一个jQuery弹出层(tipsWindown)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>链接的背景图切换一般都用CSS的HOVER来控制，虽然很方便，但效果不怎么酷，没有平滑效果，显得有点突然。在这篇文章里给大家介绍下如何用jQuery来实现一个平滑的渐变式背景切换。效果大家可以看下这个站（<a href="http://dragoninteractive.com/">http://dragoninteractive.com/</a>）。如图所示。<br />
<span id="more-728"></span></p>
<p><img src="http://leotheme.cn/wp-content/uploads/2009/08/nav.png" alt="nav" title="nav" width="495" height="96" class="alignnone size-full wp-image-729" /></p>
<p>上面的网站在中有很多地方都应用了这种效果。看起来是不是很酷。OK，进入正题；<br />
在这里我用一个简单的实例来分析下，先看下我们要用到的这张图。</p>
<p><img src="http://leotheme.cn/wp-content/uploads/2009/08/logo.png" alt="logo" title="logo" width="156" height="98" class="alignnone size-full wp-image-730" /></p>
<p>我们把背景切换的两张图做成一张。这样的好处我以前也有说过了。详见“<a href="http://leotheme.cn/javascript/about-css-background.html">CSS中关于背景图的应用技巧</a>”；接下来要做的是写结构和样式部分。</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">body</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;"> </span><span style="color: Green;">margin:</span><span style="color: Gray;"> </span><span style="color: Maroon;">0</span><span style="color: Green;"></span><span style="color: Gray;">; </span><span style="color: Green;">padding:</span><span style="color: Gray;"> </span><span style="color: Maroon;">0</span><span style="color: Green;"></span><span style="color: Gray;">; </span><span style="color: Green;">text-align:</span><span style="color: Gray;"> </span><span style="color: Red;">center</span><span style="color: Green;"></span><span style="color: Gray;">; </span><span style="color: Olive;">}</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Blue;">#logo</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;"> <br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">position:</span><span style="color: Gray;"> </span><span style="color: Red;">absolute</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">display:</span><span style="color: Gray;"> </span><span style="color: Red;">block</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">width:</span><span style="color: Gray;"> </span><span style="color: Maroon;">156</span><span style="color: Red;">px</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">height:</span><span style="color: Gray;"> </span><span style="color: Maroon;">49</span><span style="color: Red;">px</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/</span><span style="color: Blue;">*</span><span style="color: Gray;">这部分是让元素相对浏览器垂直居中<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">left:</span><span style="color: Gray;"> </span><span style="color: Maroon;">50</span><span style="color: Red;">%</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">top:</span><span style="color: Gray;"> </span><span style="color: Maroon;">50</span><span style="color: Red;">%</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">margin-left:</span><span style="color: Gray;"> -</span><span style="color: Maroon;">156</span><span style="color: Red;">px</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">margin-top:</span><span style="color: Gray;"> -</span><span style="color: Maroon;">49</span><span style="color: Red;">px</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-----------------------------------------</span><span style="color: Blue;">*</span><span style="color: Gray;">/<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">background:</span><span style="color: Gray;"> url(logo.png) </span><span style="color: Red;">top</span><span style="color: Gray;"> </span><span style="color: Red;">left</span><span style="color: Gray;"> </span><span style="color: Red;">no-repeat</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">}</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Blue;">#logo</span><span style="color: Gray;"> </span><span style="color: Blue;">span</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">text-indent:</span><span style="color: Gray;"> -</span><span style="color: Maroon;">9999</span><span style="color: Red;">em</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/</span><span style="color: Blue;">*</span><span style="color: Gray;">隐藏文字，就是以图替换文字的一种方法</span><span style="color: Blue;">*</span><span style="color: Gray;">/<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">}</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Blue;">#logo</span><span style="color: Gray;"> </span><span style="color: Blue;">.hover</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;">/</span><span style="color: Blue;">*</span><span style="color: Gray;">这个样式是为</span><span style="color: Blue;">JQ</span><span style="color: Gray;">准备的</span><span style="color: Blue;">*</span><span style="color: Gray;">/<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">position:</span><span style="color: Gray;"> </span><span style="color: Red;">absolute</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">width:</span><span style="color: Gray;"> </span><span style="color: Maroon;">156</span><span style="color: Red;">px</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">height:</span><span style="color: Gray;"> </span><span style="color: Maroon;">49</span><span style="color: Red;">px</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">top:</span><span style="color: Gray;"> </span><span style="color: Maroon;">0</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">left:</span><span style="color: Gray;"> </span><span style="color: Maroon;">0</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">background:</span><span style="color: Gray;"> url(logo.png) </span><span style="color: Maroon;">0</span><span style="color: Gray;"> -</span><span style="color: Maroon;">49</span><span style="color: Red;">px</span><span style="color: Gray;"> </span><span style="color: Red;">no-repeat</span><span style="color: Green;"></span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">}</span></div></div>
<p>这里的样式，应该不需要作解释了。很简单的一个样式！下面是结构；</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Olive;">&lt;</span><span style="color: Green;">a</span><span style="color: Gray;"> </span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">http://www.wopus.org/</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">id</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">wopus</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">span</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">wopus</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">span</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;</span></div></div>
<p>关健是JQ部分，我们来看代码：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">jQuery</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">()</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">jQuery</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">#logo</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">append</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">&lt;span class='hover'&gt;&lt;/span&gt;</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #ffa500;">//在ID为logo的标签里内部插入一个样式为hover的span</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">jQuery</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">.hover</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">css</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">opacity</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: Maroon;">0</span><span style="color: Olive;">)</span><span style="color: Gray;">; <br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #ffa500;">//设置hover的透明度为0</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">jQuery</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">.hover</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">parent</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">hover</span><span style="color: Olive;">(</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">function</span><span style="color: Olive;">()</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;"> <br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">jQuery</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">.hover</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">stop</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">animate</span><span style="color: Olive;">({</span><span style="color: Blue;">opacity</span><span style="color: Gray;">: </span><span style="color: #8b0000;">'</span><span style="color: Red;">1</span><span style="color: #8b0000;">'</span><span style="color: Olive;">}</span><span style="color: Gray;">,</span><span style="color: Maroon;">1000</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">}</span><span style="color: Gray;">, <br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">function</span><span style="color: Olive;">()</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;"> <br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">jQuery</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">.hover</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">stop</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">animate</span><span style="color: Olive;">({</span><span style="color: Gray;"> </span><span style="color: Blue;">opacity</span><span style="color: Gray;">: </span><span style="color: #8b0000;">'</span><span style="color: Red;">0</span><span style="color: #8b0000;">'</span><span style="color: Olive;">}</span><span style="color: Gray;">,</span><span style="color: Maroon;">1000</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">})</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #ffa500;">//这是一个JQ里常用的hover()效果。当鼠标放在class为hover的父元素上时。停止当前标签上的所有动画并执行后面的自定义效果—hover的透明度由0渐变成100%;当鼠标离开后反之。</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Olive;">})</span><span style="color: Gray;">;</span></div></div>
<p>看起来是不是很简单。其原理就在链接内部再插入一个元素。并通过改变这个元素的透明度来实现。有点像FLASH里的遮罩效果。最后点击下面的链接来看下效果；</p>
<p><a href="http://leotheme.cn/wp-content/uploads/Example/js/dragoninteractive/">http://leotheme.cn/wp-content/uploads/Example/js/dragoninteractive/</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery中queue和dequeue的用法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery中queue和dequeue的用法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jQuery实现个性有序列表" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-to-sequential-list.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197275.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jQuery实现个性有序列表</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jquery写一个简单的菜单伸缩效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-for-nav-slide.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197279.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jquery写一个简单的菜单伸缩效果</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 实现 tab 切换一例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-tab.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197250.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 实现 tab 切换一例</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="一个jQuery弹出层(tipsWindown)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindown.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">一个jQuery弹出层(tipsWindown)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009-06-11 -- <a href="http://leotheme.cn/javascript/jquery-tab.html" title="jQuery 实现 tab 切换一例">jQuery 实现 tab 切换一例</a> (11)<br /><small>对于Tab切换，我想大家都不陌生了。现在几乎是到处可见了；今天为大家介绍下怎么用jQuery来实现一个简单的Tab切换效果。其实这类例子网上也有很多了，在这里不讨论它的实现原理，因为都是些最基本的应用...</small></li><li>2008-11-20 -- <a href="http://leotheme.cn/javascript/zq-ued-of-links.html" title="增强用户体验之文章内的链接">增强用户体验之文章内的链接</a> (29)<br /><small>我们在写文章的时候，难免会少不了添加一些链接。这些链接有的是指向自己的BLOG内的，有的是指向好友的BLOG，或一篇文章。指向自己BLOG的称为内部链接，指向外部的称为外部链接，我们习惯是外部链接在新...</small></li><li>2011-09-08 -- <a href="http://leotheme.cn/javascript/jquery%e4%b8%adqueue%e5%92%8cdequeue%e7%9a%84%e7%94%a8%e6%b3%95.html" title="jQuery中queue和dequeue的用法">jQuery中queue和dequeue的用法</a> (1)<br /><small>今天在做右下角那个静止的工具栏时遇到了一个问题。鼠标放上去的时候，要让周围的4个按钮按顺序显示出来，移开的时候要按顺序隐藏。左思右想发现用animate的回调函数方式来写比较麻烦。于是百度了下，发现j...</small></li><li>2011-08-17 -- <a href="http://leotheme.cn/wordpress/flight-update.html" title="Flight主题更新">Flight主题更新</a> (16)<br /><small>这几天收到有些童鞋反应主题在wp3.2版本后台不能快速编缉文章，不能上传图片。抽空看了下，是JQ库版本冲突引起，现已更新。请移步到wopus主题站下载更新后的版本。也可以通过115网盘下载。...</small></li><li>2010-11-24 -- <a href="http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html" title="JQ弹出层插件(tipsWindow 2.8)">JQ弹出层插件(tipsWindow 2.8)</a> (154)<br /><small>已更新为2.7...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/jquery-dragoninteractive-navi.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

