1

jquery サイクル プラグインと jquery を使用しています。
サイクル div の高さが変化すると、jquery サイクル div をアニメーション化します。下のdivは高さに応じて上下します。

問題は、下にスクロールすると、下の div が (白い) 背景になることです。下の div を常に透明にしたいと思います。(私の例では、コンテンツ div を常に透明にしたい)

サイクルされたdivをアニメーション化するコードは次のとおりです

function onAfter(curr, next, opts, fwd) {
        var index = opts.currSlide;
        $('#prev,#prev2,#prev3,#prev4,#prev5')[index == 0 ? 'hide' : 'show']();
        $('#next,#next2,#next3,#next4,#next5')[index == opts.slideCount - 1 ? 'hide' : 'show']();
        //get the height of the current slide
        var $ht = $(this).height();
        //set the container's height to that of the current slide
        $(this).parent().animate({height: $ht});
    }

    $('.subheader').cycle({after: onAfter});

説明するのが難しいので、それを示すために jsfiddle を作成しました: jsFiddle

4

1 に答える 1