<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: jQuery для начинающих. Часть 4. Селекторы</title>
	<atom:link href="http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/feed/" rel="self" type="application/rss+xml" />
	<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/</link>
	<description>Web-разработчик</description>
	<lastBuildDate>Thu, 09 Feb 2012 12:54:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Макс</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-63096</link>
		<dc:creator>Макс</dc:creator>
		<pubDate>Tue, 10 Jan 2012 15:29:54 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-63096</guid>
		<description>Да, большое спасибо, добропорядочное комьюнити htmlbook помогло разобраться. Еще раз спасибо :)</description>
		<content:encoded><![CDATA[<p>Да, большое спасибо, добропорядочное комьюнити htmlbook помогло разобраться. Еще раз спасибо :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton Shevchuk</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-63095</link>
		<dc:creator>Anton Shevchuk</dc:creator>
		<pubDate>Mon, 09 Jan 2012 19:07:55 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-63095</guid>
		<description>1. id - он на то и айли чтобы быть уникальным - но это замечание так - не совсем по теме
2. функцию wrap в вашем случае надо применять для каждого элемента - используете ее внутри вызова each</description>
		<content:encoded><![CDATA[<p>1. id &#8211; он на то и айли чтобы быть уникальным &#8211; но это замечание так &#8211; не совсем по теме<br />
2. функцию wrap в вашем случае надо применять для каждого элемента &#8211; используете ее внутри вызова each</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: igor</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-63094</link>
		<dc:creator>igor</dc:creator>
		<pubDate>Mon, 09 Jan 2012 15:11:59 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-63094</guid>
		<description>[js]
t1	+= &#039;&lt;a href=&quot;h t t p : / / s i t e . c o m /#&#039; + t3 + &#039;&quot;&gt;&#039;;
[/js]</description>
		<content:encoded><![CDATA[<pre class="brush: jscript; title: ; notranslate">
t1	+= '&lt;a href=&quot;h t t p : / / s i t e . c o m /#' + t3 + '&quot;&gt;';
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: igor</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-63093</link>
		<dc:creator>igor</dc:creator>
		<pubDate>Mon, 09 Jan 2012 15:11:22 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-63093</guid>
		<description>...
[js]
t1	+= &#039;&lt;a href=&quot;http://site.com/#&#039; + t3 + &#039;&quot;&gt;&#039;;
[/js]
...</description>
		<content:encoded><![CDATA[<p>&#8230;</p>
<pre class="brush: jscript; title: ; notranslate">
t1	+= '&lt;a href=&quot;<a href="http://site.com/#" rel="nofollow">http://site.com/#</a>' + t3 + '&quot;&gt;';
</pre>
<p>&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: igor</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-63092</link>
		<dc:creator>igor</dc:creator>
		<pubDate>Mon, 09 Jan 2012 15:10:13 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-63092</guid>
		<description>Там при вставке кода в одной строчке (№21) ересь какая-то появилась. 
Поэтому пишу отдельно, чтобы было понятно:

...
t1	+= &#039;&lt;a href=&quot;http://site.com/#&#039; + t3 + &#039;&quot; rel=&quot;nofollow&quot;&gt;&#039;;
...</description>
		<content:encoded><![CDATA[<p>Там при вставке кода в одной строчке (№21) ересь какая-то появилась.<br />
Поэтому пишу отдельно, чтобы было понятно:</p>
<p>&#8230;<br />
t1	+= &#8216;<a href="http://site.com/#' + t3 + '" rel="nofollow">&#8216;;<br />
&#8230;</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: igor</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-63091</link>
		<dc:creator>igor</dc:creator>
		<pubDate>Mon, 09 Jan 2012 15:01:19 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-63091</guid>
		<description>[html]

&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
        &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
    &lt;/head&gt;
 
    &lt;body&gt;
        &lt;div id=&quot;message&quot;&gt;
            [gimg]p1.jpg[/gimg]
            [gimg]p2.jpg[/gimg]
            [gimg]p3.jpg[/gimg]
        &lt;/div&gt;
        &lt;script type=&quot;text/javascript&quot;&gt;
            $(document).ready(function() {
                $(&#039;#message&#039;).html($(&#039;#message&#039;).html().replace(/\[gimg]/g, &#039;&lt;img id=&quot;gimg&quot; width=&quot;200&quot; height=&quot;140&quot; src=&quot;&#039;).replace(/\[\/gimg]/g, &#039;&quot; /&gt;&#039;));
                $(&#039;img[id=gimg]&#039;).wrap(function(){
			var t1	= &#039;&#039;;
			var t2	= $(this).html();
			var t3	= $(this).attr(&#039;src&#039;);
			t1	= &#039;&lt;div&gt;&#039;;
			t1	+= &#039;&lt;a href=&quot;http://site.com/#&#039; + t3 + &#039;&quot;&gt;&#039;;
			t1	+= t3;
			t1	+= &#039;&lt;div&gt;&lt;/div&gt;&#039;;
			t1	+= t2;
			t1	+= &#039;&lt;div&gt;&lt;/div&gt;&#039;;
			t1	+= &#039;&lt;/a&gt;&#039;;
			t1	+= &#039;&lt;div&gt;&lt;/div&gt;&#039;;
			t1	+= &#039;&lt;/div&gt;&#039;;
			return t1;
		});

            });
        &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;


[/html]</description>
		<content:encoded><![CDATA[<pre class="brush: xml; title: ; notranslate">

&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
        &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;div id=&quot;message&quot;&gt;
            [gimg]p1.jpg[/gimg]
            [gimg]p2.jpg[/gimg]
            [gimg]p3.jpg[/gimg]
        &lt;/div&gt;
        &lt;script type=&quot;text/javascript&quot;&gt;
            $(document).ready(function() {
                $('#message').html($('#message').html().replace(/\[gimg]/g, '&lt;img id=&quot;gimg&quot; width=&quot;200&quot; height=&quot;140&quot; src=&quot;').replace(/\[\/gimg]/g, '&quot; /&gt;'));
                $('img[id=gimg]').wrap(function(){
			var t1	= '';
			var t2	= $(this).html();
			var t3	= $(this).attr('src');
			t1	= '&lt;div&gt;';
			t1	+= '&lt;a href=&quot;<a href="http://site.com/#" rel="nofollow">http://site.com/#</a>' + t3 + '&quot;&gt;';
			t1	+= t3;
			t1	+= '&lt;div&gt;&lt;/div&gt;';
			t1	+= t2;
			t1	+= '&lt;div&gt;&lt;/div&gt;';
			t1	+= '&lt;/a&gt;';
			t1	+= '&lt;div&gt;&lt;/div&gt;';
			t1	+= '&lt;/div&gt;';
			return t1;
		});

            });
        &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Макс</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-63090</link>
		<dc:creator>Макс</dc:creator>
		<pubDate>Mon, 09 Jan 2012 09:41:24 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-63090</guid>
		<description>Доброго всем времени суток. Буду очень признателен, если кто-нибудь сможет мне помочь. Являюсь дизайнером на сайте, решил прикрутить галерею картинок (за основу взял плагин fancybox). Проблема состоит в следующем - мне нужно написать скрипт замены ббкода [gimg][/gimg] на хтмл&#039;ный вариант. И все бы хорошо, да вот незадача - при выборке элементов через фильтр&lt;code&gt;$(&#039;img[id=gimg]&#039;).attr(&#039;src&#039;)&lt;/code&gt; берется путь к файлу &lt;b&gt;только первой&lt;/b&gt; картинки. И далее подставляется во все картинки. Итог - превью разные, а изображения в галерее одинаковые. Ниже привожу полный код страницы:
[html]&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.7.1.min.js&quot;&gt;&lt;/script&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;./fancybox/jquery.fancybox-1.3.4.packed.js&quot;&gt;&lt;/script&gt;
		&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;./fancybox/jquery.fancybox-1.3.4.css&quot; media=&quot;screen&quot; /&gt;
	&lt;/head&gt;
	
	&lt;body&gt;
		&lt;div id=&quot;message&quot;&gt;
			[gimg]./images/img01.jpg[/gimg]
			[gimg]./images/img02.jpg[/gimg]
		&lt;/div&gt;
		&lt;script type=&quot;text/javascript&quot;&gt;
			$(document).ready(function() {
				$(&#039;#message&#039;).html($(&#039;#message&#039;).html().replace(/\[gimg]/g, &#039;&lt;img id=&quot;gimg&quot; width=&quot;320&quot; height=&quot;240&quot; src=&quot;&#039;).replace(/\[\/gimg]/g, &#039;&quot; /&gt;&#039;));
				$(&#039;img[id=gimg]&#039;).wrap(&#039;&lt;a rel=&quot;gimg&quot; href=&quot;&#039;+$(&#039;img[id=gimg]&#039;).attr(&#039;src&#039;)+&#039;&quot;&gt;&lt;/a&gt;&#039;);
				$(&#039;a[rel=gimg]&#039;).fancybox();
			});
		&lt;/script&gt;
	&lt;/body&gt;
&lt;/html&gt;[/html]
Заранее спасибо за помощь</description>
		<content:encoded><![CDATA[<p>Доброго всем времени суток. Буду очень признателен, если кто-нибудь сможет мне помочь. Являюсь дизайнером на сайте, решил прикрутить галерею картинок (за основу взял плагин fancybox). Проблема состоит в следующем &#8211; мне нужно написать скрипт замены ббкода [gimg][/gimg] на хтмл&#8217;ный вариант. И все бы хорошо, да вот незадача &#8211; при выборке элементов через фильтр<code>$('img[id=gimg]').attr('src')</code> берется путь к файлу <b>только первой</b> картинки. И далее подставляется во все картинки. Итог &#8211; превью разные, а изображения в галерее одинаковые. Ниже привожу полный код страницы:</p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&#038;gt" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&#038;gt</a>;
&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml&quot;&#038;gt" rel="nofollow">http://www.w3.org/1999/xhtml&quot;&#038;gt</a>;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.7.1.min.js&quot;&gt;&lt;/script&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;./fancybox/jquery.fancybox-1.3.4.packed.js&quot;&gt;&lt;/script&gt;
		&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;./fancybox/jquery.fancybox-1.3.4.css&quot; media=&quot;screen&quot; /&gt;
	&lt;/head&gt;

	&lt;body&gt;
		&lt;div id=&quot;message&quot;&gt;
			[gimg]./images/img01.jpg[/gimg]
			[gimg]./images/img02.jpg[/gimg]
		&lt;/div&gt;
		&lt;script type=&quot;text/javascript&quot;&gt;
			$(document).ready(function() {
				$('#message').html($('#message').html().replace(/\[gimg]/g, '&lt;img id=&quot;gimg&quot; width=&quot;320&quot; height=&quot;240&quot; src=&quot;').replace(/\[\/gimg]/g, '&quot; /&gt;'));
				$('img[id=gimg]').wrap('&lt;a rel=&quot;gimg&quot; href=&quot;'+$('img[id=gimg]').attr('src')+'&quot;&gt;&lt;/a&gt;');
				$('a[rel=gimg]').fancybox();
			});
		&lt;/script&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Заранее спасибо за помощь</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton Shevchuk</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-63075</link>
		<dc:creator>Anton Shevchuk</dc:creator>
		<pubDate>Sun, 25 Dec 2011 14:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-63075</guid>
		<description>Это я второй спан не заметил, когда слайды рисовал</description>
		<content:encoded><![CDATA[<p>Это я второй спан не заметил, когда слайды рисовал</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Олег</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-63074</link>
		<dc:creator>Олег</dc:creator>
		<pubDate>Sun, 25 Dec 2011 13:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-63074</guid>
		<description>не понял 9й слайд: почему функция html() выбирает только текст в первом span-теге, а txt() - в обоих?</description>
		<content:encoded><![CDATA[<p>не понял 9й слайд: почему функция html() выбирает только текст в первом span-теге, а txt() &#8211; в обоих?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: direqtror</title>
		<link>http://anton.shevchuk.name/javascript/jquery-for-beginners-selectors/comment-page-2/#comment-62996</link>
		<dc:creator>direqtror</dc:creator>
		<pubDate>Tue, 22 Nov 2011 09:13:12 +0000</pubDate>
		<guid isPermaLink="false">http://anton.shevchuk.name/?p=591#comment-62996</guid>
		<description>Нет не одинаково. Во втором случае сработают только прямые потомки элементов.

Т.е. [html]&lt;div&gt;&lt;p&gt;&lt;img /&gt;&lt;/p&gt;&lt;/div&gt;[/html] – сработает и в первом и во втором случае, а вот [html]&lt;div&gt;&lt;p&gt;&lt;a&gt;&lt;img /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;[/html] – только в первом.</description>
		<content:encoded><![CDATA[<p>Нет не одинаково. Во втором случае сработают только прямые потомки элементов.</p>
<p>Т.е.
<pre class="brush: xml; title: ; notranslate">&lt;div&gt;&lt;p&gt;&lt;img /&gt;&lt;/p&gt;&lt;/div&gt;</pre>
<p> – сработает и в первом и во втором случае, а вот
<pre class="brush: xml; title: ; notranslate">&lt;div&gt;&lt;p&gt;&lt;a&gt;&lt;img /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</pre>
<p> – только в первом.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

