【问题标题】:Jquery quicksand not scalingJquery流沙不缩放
【发布时间】:2012-05-17 02:54:04
【问题描述】:

每件事都按我想要的方式工作,唯一的问题是当您单击过滤器(一张床/两张床)时它不会缩放,它只会褪色。原始的 quciksand 示例在过滤器之间淡出和缩放

这是我的例子 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/

【问题讨论】:

  • 请您接受答案。谢谢。

标签: jquery quicksand jquery-easing


【解决方案1】:

您是否在项目中添加了所需的插件(如原网站所述)?

如果没有,请先下载这两个插件:

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

我知道在主网站上他们说你只需要添加第一个,但我尝试了,直到我添加了第二个它才起作用。 然后不要忘记在 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>

我希望它会工作;)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多