【问题标题】:ContentFlow javascript - reloading images after filteringContentFlow javascript - 过滤后重新加载图像
【发布时间】:2012-10-01 18:25:19
【问题描述】:

我正在使用以下“Coverflow”javascript,ContentFlow

并具有过滤功能,可以在 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");

  });

任何帮助将不胜感激!

【问题讨论】:

    标签: javascript jquery filtering coverflow


    【解决方案1】:

    您可以使用数组来存储所有图像的信息,然后根据过滤条件和数组使用ContentFlowaddItem()rmItem() 函数。

    使用这种方法,您可以从数组项中动态重新加载流。

    【讨论】:

      猜你喜欢
      • 2014-10-02
      • 2011-03-29
      • 1970-01-01
      • 1970-01-01
      • 2022-01-19
      • 1970-01-01
      • 1970-01-01
      • 2020-03-21
      • 2011-10-28
      相关资源
      最近更新 更多