0

こんにちは、「ティック」という名前のクラスを持つ 2 つの部門があります。

div1 : <div class="home tick">
div2 : <div class="rbar tick">

問題: 1 つの div でコンテンツがオーバーフローした場合、他の div も解決策を刻み始めますか?

if( ($('.tick > ul').height()) > 160){
    $('.tick').vTicker({ 
        speed: 500,
        pause: 3000,
        animation: 'fade',
        showItems: 3,
        height: 192
    });
}
4

1 に答える 1

2

各 div を個別に取得します。

$('.tick > ul').each(function(){
  if( ($(this).height()) > 160){
    $(this).parent().vTicker({ 
        speed: 500,
        pause: 3000,
        animation: 'fade',
        showItems: 3,
        height: 192
    });
  }
})
于 2012-09-03T11:36:29.877 に答える