SORU
7 EKİM 2008, Salı


Bir öğe olmadığını kontrol gizlidir

JQuery, bir öğenin görünürlüğünü değiştirmek için olası işlevleri .hide(), .show() .toggle() kullanıyor.

JQuery kullanarak, nasıl eğer bir elemanın görünür veya gizli olup olmadığını test edersin?

CEVAP
7 EKİM 2008, Salı


Soru tek bir öğe anlamına gelir bu yana, bu kodu daha uygun olabilir:

// Checks for display:[none|block], ignores visible:[true|false]
$(element).is(":visible"); 

twernt's suggestion ama tek bir öğeye uygulanan; ve aynı matches the algorithm recommended in the jQuery FAQ

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • DJPixcell

    DJPixcell

    20 NİSAN 2007
  • Schmittastic Jr.

    Schmittastic

    19 Mart 2013
  • warningthepeople

    warningthepe

    21 EYLÜL 2011