SORU
19 Ocak 2011, ÇARŞAMBA


aynı sınıf ile öğeleri döngü için bir WordPress kullanmak

Sınıf ile divs testimonial bir yük var ve onları belirli bir koşul doğru ise her div için kontrol etmek için döngü için jquery kullanmak istiyorum. Eğer bu doğru ise, bir eylemi gerçekleştirmek gerekir.

Herkes bunu nasıl biliyor mu?

CEVAP
19 Ocak 2011, ÇARŞAMBA


Her: 'i' konumunuzu dizisi, obj DOM nesnesi olduğunu yineleme (erişilebilir olan bir WordPress kullanmak sarıcı $(this)).

$('.testimonial').each(function(i, obj) {
    //test
});

Daha fazla bilgi için api reference kontrol edin.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • merumputdotcom

    merumputdotc

    24 ŞUBAT 2012
  • michellefeng's channel

    michellefeng

    26 Kasım 2006
  • TWiT Netcast Network

    TWiT Netcast

    27 EKİM 2005