2

すべてが私が望むように機能しています。唯一の問題は、フィルター (1 つのベッド/2 つのベッド) をクリックしたときにスケーリングされず、フェードのみであるということです。元のクイックサンドの例は、フィルター間でフェードおよびスケールします

ここに私の例があります http://theoaks.turnpostadmin.com/floor-plans/

私のコード

    // jQuery Quicksand project categories filtering


 jQuery.noConflict();
 jQuery(document).ready(function($){
// Clone applications to get a second collection
var $data = $(".portfolio-content").clone();

//NOTE: Only filter on the main portfolio page, not on the subcategory pages
$('.portfolio-main li').click(function(e) {
    $(".filter li").removeClass("active");  
    // Use the last category class as the category to filter by. This means that multiple categories are not supported (yet)
    var filterClass=$(this).attr('class').split(' ').slice(-1)[0];

    if (filterClass == 'all-projects') {
        var $filteredData = $data.find('.project');
    } else {
        var $filteredData = $data.find('.project[data-type=' + filterClass + ']');
    }
    $(".portfolio-content").quicksand($filteredData, {
        duration: 750,
        easing: 'swing',
        attribute: 'data-id', // attribute to recognize same items within source and dest
        adjustHeight: 'auto', // 'dynamic' animates height during shuffling (slow), 'auto' adjusts it before or after the animation, false leaves height constant
        useScaling: true, // disable it if you're not using scaling effect or want to improve performance
        enhancement: function(c) {}, // Visual enhacement (eg. font replacement) function for cloned elements
        selector: '> *',
        dx: 0,
        dy: 0
    }, function() { 
    });     
    $(this).addClass("active");             
    return false;
});
   });

ここにオリジナルがあります http://razorjack.net/quicksand/

4

1 に答える 1

1

プロジェクトに必要なプラグインを追加しましたか (元の Web サイトに記載されています)。

そうでない場合は、まず次の 2 つのプラグインをダウンロードしてください。

https://github.com/zachstronaut/jquery-animate-css-rotate-scale/blob/master/jquery-animate-css-rotate-scale.js

https://github.com/zachstronaut/jquery-css-transform/blob/master/jquery-css-transform.js

メインのウェブサイトでは、最初のものを追加するだけでよいと書かれていることは知っていますが、試してみたところ、2 つ目を追加するまで機能しませんでした。次に、head タグにこれらのプラグインへのリンクを含めることを忘れないでください。

<script type="text/javascript" src="js/jquery-css-transform.js" ></script>
<script type="text/javascript" src="js/jquery-animate-css-rotate-scale.js" ></script>

うまくいくことを願っています;)

于 2012-05-16T18:54:04.407 に答える