﻿
{"id":4506,"date":"2016-06-20T22:06:45","date_gmt":"2016-06-20T22:06:45","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=4506"},"modified":"2016-06-20T22:07:48","modified_gmt":"2016-06-20T22:07:48","slug":"jquery-eq-fonksiyonunun-kullanimi","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/jquery-eq-fonksiyonunun-kullanimi\/","title":{"rendered":"jQuery &#8211; eq Fonksiyonunun Kullan\u0131m\u0131"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>jQuery&#8217;de e\u015fitlik durumlar\u0131n\u0131 kontrol eden ve aslen equalizer ifadesinin k\u0131saltmas\u0131 olan eq fonksiyonunu inceleyece\u011fiz.<\/p>\n<p>Asl\u0131nda bir operat\u00f6r tarz\u0131 kullan\u0131ma sahip olan bu fonksiyonun \u00e7al\u0131\u015fma mant\u0131\u011f\u0131 \u015f\u00f6yledir ki, bir eleman k\u00fcmesinde indexi verilen eleman\u0131 yakalamam\u0131z\u0131 sa\u011flamaktad\u0131r.<\/p>\n<p>eq fonksiyonunun prototipini incelememiz gerekirse e\u011fer;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            $(&quot;nesne ic-eleman:eq(index)&quot;)\r\n<\/pre>\n<p>bu modelde index de\u011ferine denk gelen eleman\u0131 elde edebilmekteyiz.<\/p>\n<p>\u00d6rne\u011fin a\u015fa\u011f\u0131daki yap\u0131y\u0131 ele alal\u0131m.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    &lt;ul id=&quot;Liste&quot;&gt;\r\n        &lt;li&gt;Bin atl\u0131 ak\u0131nlarda \u00e7ocuklar gibi \u015fendik&lt;\/li&gt;\r\n        &lt;li&gt;Bin atl\u0131 o g\u00fcn dev gibi bir orduyu yendik&lt;\/li&gt;\r\n        &lt;li&gt;Hayk\u0131rd\u0131, ak tolgal\u0131 beylerbeyi &quot;\u0130lerle!&quot;&lt;\/li&gt;\r\n        &lt;li&gt;Bir yaz g\u00fcn\u00fc ge\u00e7tik Tuna'dan kafilelerle&lt;\/li&gt;\r\n    &lt;\/ul&gt;\r\n<\/pre>\n<p>Bu ul yap\u0131s\u0131 i\u00e7erisindeki li etiketleri arkaplanda 0&#8217;dan (n-1)&#8217;e do\u011fru indexlenmektedir. Haliyle eq fonksiyonu ile a\u015fa\u011f\u0131daki gibi bir \u00e7al\u0131\u015fma ger\u00e7ekle\u015ftirebiliriz.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    &lt;style type=&quot;text\/css&quot;&gt;\r\n        .secici {\r\n            color: #FFFFFF;\r\n            background-color: #0000FF;\r\n        }\r\n    &lt;\/style&gt;\r\n--------------\r\n    &lt;input type=&quot;button&quot; onClick=&quot;Sec();&quot; value=&quot;Sec&quot; \/&gt;\r\n\r\n    &lt;script type=&quot;text\/javascript&quot;&gt;\r\n        function Sec() {\r\n            $(&quot;#Liste li:eq(1)&quot;).addClass(&quot;secici&quot;);\r\n        }\r\n    &lt;\/script&gt;\r\n<\/pre>\n<p>Bu i\u015flem neticesinde ekran g\u00f6r\u00fcnt\u00fcs\u00fc a\u015fa\u011f\u0131daki gibi olacakt\u0131r.<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2016\/06\/jQuery-eq-Fonksiyonunun-Kullan\u0131m\u0131.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2016\/06\/jQuery-eq-Fonksiyonunun-Kullan\u0131m\u0131-300x109.jpg\" alt=\"jQuery - eq Fonksiyonunun Kullan\u0131m\u0131\" width=\"300\" height=\"109\" class=\"aligncenter size-medium wp-image-4509\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2016\/06\/jQuery-eq-Fonksiyonunun-Kullan\u0131m\u0131-300x109.jpg 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2016\/06\/jQuery-eq-Fonksiyonunun-Kullan\u0131m\u0131.jpg 312w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Evet, anlayaca\u011f\u0131n\u0131z eq fonksiyonu verilen indexteki eleman\u0131 yakalayabilmek i\u00e7in kullan\u0131lmaktad\u0131r.<\/p>\n<p>\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>jQuery&#8217;de e\u015fitlik durumlar\u0131n\u0131 kontrol eden ve aslen equalizer ifadesinin k\u0131saltmas\u0131 olan eq fonksiyonunu inceleyece\u011fiz. Asl\u0131nda bir operat\u00f6r tarz\u0131 kullan\u0131ma sahip olan bu fonksiyonun \u00e7al\u0131\u015fma mant\u0131\u011f\u0131 \u015f\u00f6yledir ki, bir eleman k\u00fcmesinde indexi verilen eleman\u0131 yakalamam\u0131z\u0131&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":3401,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[1245,1244,748],"class_list":["post-4506","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery","tag-eq","tag-eq-fonksiyonu","tag-jquery"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/4506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=4506"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/4506\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/3401"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=4506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=4506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=4506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}