2012-08-04 64 views
0

jQuery砌体是伟大的,但是,有没有人能够获得角落邮票出现在页面的左上角?我尝试更改为float: left;,但这似乎不起作用。jQuery梅森角落邮票

此外,当我调整窗口的大小时,调整大小不会自动调整角标。

这里的CSS

.corner-stamp { 
width: 270px; 
height: 300px; 
padding: 10px; 
float: right; 
background: red; 
color: white; 
-moz-border-radius: 15px 0px 15px 0px; 
-webkit-border-radius: 15px 0px 15px 0px; 
border-radius: 15px 0px 15px 0px; 
} 

和这里的JS:

$.Mason.prototype.resize = function() { 
    this._getColumns(); 
    this._reLayout(); 
}; 
$.Mason.prototype._reLayout = function(callback) { 
    var $cornerStamp, cornerStampX, freeCols, i; 
    freeCols = this.cols; 
    if (this.options.cornerStampSelector) { 
    $cornerStamp = this.element.find(this.options.cornerStampSelector); 
    cornerStampX = $cornerStamp.offset().left - (this.element.offset().left + this.offset.x + parseInt($cornerStamp.css("marginLeft"))); 
    freeCols = Math.floor(cornerStampX/this.columnWidth); 
    } 
    i = this.cols; 
    this.colYs = []; 
    while (i--) { 
    this.colYs.push(this.offset.y); 
    } 
    i = freeCols; 
    while (i < this.cols) { 
    this.colYs[i] = this.offset.y + $cornerStamp.outerHeight(true); 
    i++; 
    } 
    this.layout(this.$bricks, callback); 
}; 
$container = $("#streams"); 
$container.imagesLoaded(function() { 
    $container.masonry({ 
    itemSelector: ".stream-item", 
    columnWidth: 60, 
    isAnimated: false, 
    isFitWidth: true, 
    cornerStampSelector: '.corner-stamp' 
    }); 
}); 

回答

0

对于float留下的代码,你最好的选择是保证“加盖印花的”瓷砖是您列表中的第一个瓷砖。

此外,我一直在玩角落冲压,并注意到设置isFitWidth: true干扰角落冲压。

如果您发现了一个更好的左转角印花方式,请告诉我。如果你找到了一个右转角的方法,但在页面中心的瓷砖,请让我知道。

谢谢。