Jquery流沙不可缩放
每件事都按我所希望的方式进行,唯一的问题是当你点击过滤器(一张床/两张床)时,它不会缩放,它只会褪色。原始的quciksand示例在过滤器之间淡入淡出并缩放 这是我的例子 我的代码Jquery流沙不可缩放,jquery,quicksand,jquery-easing,Jquery,Quicksand,Jquery Easing,每件事都按我所希望的方式进行,唯一的问题是当你点击过滤器(一张床/两张床)时,它不会缩放,它只会褪色。原始的quciksand示例在过滤器之间淡入淡出并缩放 这是我的例子 我的代码 // jQuery Quicksand project categories filtering jQuery.noConflict(); jQuery(document).ready(function($){ // Clone applications to get a second collec
// 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;
});
});
这是原件
您是否向项目中添加了所需的插件(如原始网站所述) 如果没有,请先下载以下两个插件: 我知道在主网站上他们说你只需要添加第一个,但我尝试了,直到我添加了第二个才起作用。 然后别忘了在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>
我希望它能起作用;) 你能接受这个答案吗。谢谢