SORU
26 Kasım 2009, PERŞEMBE


Nasıl görünüm (eleman.bir tabloya bir satır kaydırma mı scrollıntoview) kullanarak bir WordPress kullanmak?

Dinamik olarak bir tablo jQuery kullanarak satır ekliyorum. table overflow:auto böylece dikey bir kaydırma çubuğu neden olan div içinde.

Şimdi benim kap div son satır oto etmek istiyorum. tr.scrollintoView() jQuery versiyonu nedir?

thx

CEVAP
23 EYLÜL 2010, PERŞEMBE


Bu aşağıdaki listeden rastgele bir öğe (yerine hep alt) gidin gerekirse: daha iyi çalışır

function scrollIntoView(element, container) {
  var containerTop = $(container).scrollTop(); 
  var containerBottom = containerTop   $(container).height(); 
  var elemTop = element.offsetTop;
  var elemBottom = elemTop   $(element).height(); 
  if (elemTop < containerTop) {
    $(container).scrollTop(elemTop);
  } else if (elemBottom > containerBottom) {
    $(container).scrollTop(elemBottom - $(container).height());
  }
}

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • DRDAnimation

    DRDAnimation

    28 EYLÜL 2012
  • Tek Syndicate

    Tek Syndicat

    23 Temmuz 2008
  • Video-Tutorials.Net

    Video-Tutori

    15 Mart 2011