0

私の実際の必要性は、最初に3つのthumbnail画像を表示する必要があります。次をクリックすると、次の3つの新しいサムネイル画像が表示されます。このリンクを参照する場合 http://www.frontendwebhelp.com/javascript/jquery-photo-gallery.php

これはまさに私が必要としていたものです。ここで、次のボタンと前のボタンの機能は、サムネイル画像と大きい画像では異なります。

この効果を得るために、いかなる種類のカルーセルプラグインも使用しないでください。

これが私が試したことです。

http://jsfiddle.net/L7yKp/37/

助けが必要です。

4

1 に答える 1

0

http://jsfiddle.net/L7yKp/60/を参照してください

function thumbs(i,incr){
    var num_thumbs=2;
    if(i===null){
        i=$("#thumbs").prop('data-index'),
        i+=num_thumbs*incr;
    }
    i=Math.max(1,Math.min(i,$('#thumbs .UiUx3DSSVFlow').length-num_thumbs+1));
    $("#thumbs").prop('data-index',i);
    $('#thumbs .UiUx3DSSVFlow').hide();
    $('#thumbs .UiUx3DSSVFlow:nth-child(n+'+i+'):nth-child(-n+'+Number(i+num_thumbs-1)+')').show();
}
$("#panel .UiUx3DSSVFlow").not(':first').hide();
$("#thumbs .UiUx3DSSVFlow").click(function(){
    getIndex = $(this).index();
    $("#thumbs .clicked").removeClass('clicked');
    $("#panel .UiUx3DSSVFlow").hide().eq(getIndex).show();  
    $(this).addClass('clicked');
    thumbs(getIndex+1);        
});
$("#thumbs .UiUx3DSSVFlow:first").click();
$("#thumbs").prop('data-index',1);
$([['next',1],['prev',-1]]).each(function(){
    var that=this;
    $('#t'+that[0]).click(function(){
        thumbs(null,that[1]);
    });
    $('#l'+that[0]).click(function(){
        $('#thumbs .clicked')[that[0]]().click();
    });
});
$('#tprev').click();
于 2012-08-28T15:21:02.700 に答える