Quicksand margins change when animating

danielsbear

New Member
Working on a sitehttp://lsmcreative.co.nz/I get a funny bug when using the nav to filter the thumbs. The images do a wierd movement to the left when animatingThe container is position relative like the documentation I am not sure what is going onMy code is like thisand pretty much when you click on a button in the menu the thumbs are all of a sudde pushed like 200px to the left and then animate back into place? \[code\] // Custom sorting plugin (function($) { $.fn.sorted = function(customOptions) { var options = { reversed: false, by: function(a) { return a.text(); } }; $.extend(options, customOptions); $data = http://stackoverflow.com/questions/15518460/$(this); arr = $data.get(); arr.sort(function(a, b) { var valA = options.by($(a)); var valB = options.by($(b)); if (options.reversed) { return (valA < valB) ? 1 : (valA > valB) ? -1 : 0; } else { return (valA < valB) ? -1 : (valA > valB) ? 1 : 0; } }); return $(arr); }; })(jQuery); // DOMContentLoaded $(function() { // bind radiobuttons in the form var $btn = $('#navigation ul li a'); // get the first collection var $projectThumbs = $('#portfolio'); // clone applications to get a second collection var $data = http://stackoverflow.com/questions/15518460/$projectThumbs.clone(); // attempt to call Quicksand on every form change $btn.click(function(e) { e.preventDefault(); if($(this).data("type") == "all"){ $btn.removeClass("selected"); $(this).addClass("selected"); var $filteredData = http://stackoverflow.com/questions/15518460/$data.find('li'); } else { $btn.removeClass("selected"); $(this).addClass("selected"); var $filteredData = http://stackoverflow.com/questions/15518460/$data.find('li[data-type~=' + $(this).data("type") + ']'); } // end $btn.click function $projectThumbs.quicksand($filteredData, { adjustHeight: 'auto', // This is the line you are looking for. duration: 800, easing: 'easeInOutQuad' }, function(){ // call js on the cloned divs $("a.grouped_elements").fancybox(); }); }); }); \[/code\]
 
Back
Top