0

次の「Coverflow」javascript、ContentFlowを使用しています。

コンテンツフローで画像タイトルを検索してフィルタリングするフィルター機能があります。検索機能の後にフィルター処理された画像をリロードするには、Contentflow が必要です。「フロー」をフィルタリングしてリロードするために機能する次のコードがありますが、フィルタリングされた画像ではなく、すべての画像をリロードします。明らかに、これを行うための適切なコードがありません。フィルター処理された画像を読み込むには、少し助けが必要です。

$("#filter").keyup(function(){
global.canChangeImage = true;
    // Retrieve the input field text and reset the count to zero
    var filter = $(this).val(), count = 0; 
    // Loop through the comment list
    $("a.item").each(function(){
        // If the list item does not contain the text phrase fade it out
        if ($(this).text().search(new RegExp(filter, "i")) < 0) {
            $(this).fadeOut();
        // Show the list item if the phrase matches and increase the count by 1
        } else {
            $(this).show();
 var contentFlow = new ContentFlow('contentFlow');
       contentFlow._init();    
           count++;
        }
    });

    // Update the count
    var numberItems = count;
    $("#filter-count").text(count+" Images Found");

  });

どんな助けでも大歓迎です!

4

1 に答える 1

0

配列を使用してすべての画像情報を保存し、フィルター条件と配列に応じてContentFlowaddItem()と関数を使用できます。rmItem()

このアプローチを使用すると、配列アイテムから動的にフローをリロードできます。

于 2012-09-30T17:31:54.163 に答える