Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

sets the width to the current element's width if it has been changed …

…by a responsive design.
  • Loading branch information...
commit f93aca188af574210a4f39eb304a09eb888f4222 1 parent 84df2d5
@kiwiupover kiwiupover authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 jquery.quicksand.js
View
7 jquery.quicksand.js
@@ -59,6 +59,8 @@ Github site: http://github.com/razorjack/quicksand
var $source = $(this).find(options.selector); // source collection items
+ var width = $($source).innerWidth(); // need for the responsive design
+
// Replace the collection and quit if IE6
if ($.browser.msie && $.browser.version.substr(0,1)<7) {
$sourceParent.html('').append($collection);
@@ -140,7 +142,9 @@ Github site: http://github.com/razorjack/quicksand
}
rawObj.style.position = 'absolute';
- rawObj.style.margin = '0';
+ rawObj.style.margin = '0';
+
+ rawObj.style.width = (width + 'px'); // sets the width to the current element with even if it has been changed by a responsive design
rawObj.style.top = (offsets[i].top - parseFloat(rawObj.style.marginTop) - correctionOffset.top + dy) + 'px';
rawObj.style.left = (offsets[i].left - parseFloat(rawObj.style.marginLeft) - correctionOffset.left + dx) + 'px';
@@ -284,6 +288,7 @@ Github site: http://github.com/razorjack/quicksand
var rawDestElement = d.get(0);
rawDestElement.style.position = 'absolute';
rawDestElement.style.margin = '0';
+ rawDestElement.style.width = width + 'px'; // sets the width to the current element with even if it has been changed by a responsive design
rawDestElement.style.top = destElement.offset().top - correctionOffset.top + 'px';
rawDestElement.style.left = destElement.offset().left - correctionOffset.left + 'px';
d.css('opacity', 0.0); // IE
Please sign in to comment.
Something went wrong with that request. Please try again.