<?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>自动相关文章列表 | 皇家元林</title>
	<atom:link href="https://hjyl.org/tags/%E8%87%AA%E5%8A%A8/feed/" rel="self" type="application/rss+xml" />
	<link>https://hjyl.org</link>
	<description>刘元林的个人博客</description>
	<lastBuildDate>Tue, 29 Mar 2011 06:08:02 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://img.hjyl.org/uploads/2019/10/cropped-about-me-32x32.png</url>
	<title>自动相关文章列表 | 皇家元林</title>
	<link>https://hjyl.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>jQuery为每张图片链接自动加上class属性</title>
		<link>https://hjyl.org/jquery-add-class-pic/</link>
					<comments>https://hjyl.org/jquery-add-class-pic/#comments</comments>
		
		<dc:creator><![CDATA[皇家元林]]></dc:creator>
		<pubDate>Tue, 29 Mar 2011 06:08:02 +0000</pubDate>
				<category><![CDATA[元林手札]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[属性]]></category>
		<category><![CDATA[自动]]></category>
		<category><![CDATA[链接]]></category>
		<guid isPermaLink="false">http://hjyl.org/?p=1504</guid>

					<description><![CDATA[jQuery为每张图片链接自动加上class属性]]></description>
										<content:encoded><![CDATA[<p>先上码：</p>
<pre lang="language" line="1">
/* 用 jQuery 为每张图片链接自动加上 class="thickbox" */
$('#content p a').each(function(){ //根据主题内容区的 id 设置选择器
var a_href = $(this).attr('href').toLowerCase();
var file_type = a_href.substring(a_href.lastIndexOf('.'));
if (file_type == '.jpg' || file_type == '.png' || file_type == '.gif'){$(this).addClass('thickbox')};
});
</pre>
<p>这个再配合lightbox之类的图片展示代码用起来不错。<br />
此代码发现于ZWW-http://zww.me/archives/25196</p>
<p>还有一个<br />
[warning]<code>$('.entry a:has(img)').addClass("thickbox");</code>[/warning]</p>
<div id="content-copyright"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;font-size: 13px;">版权声明: </span><span style="font-size: 13px;">本文采用 <a href="https://hjyl.org/go/aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzMuMC8=" rel="nofollow" target="_blank">BY-NC-SA</a> 协议进行授权，如无注明均为原创，转载请注明转自 <a href="https://hjyl.org">皇家元林</a><br>本文链接: <a rel="bookmark" title="jQuery为每张图片链接自动加上class属性" href="https://hjyl.org/jquery-add-class-pic/">jQuery为每张图片链接自动加上class属性</a></span></div>]]></content:encoded>
					
					<wfw:commentRss>https://hjyl.org/jquery-add-class-pic/feed/</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
			</item>
	</channel>
</rss>
