Browse Source

js : cellByRowLayout centered

pull/14/head
David DeSandro 14 years ago
parent
commit
59fab7566f
  1. 11
      src/jquery.molequul.js

11
src/jquery.molequul.js

@ -621,14 +621,15 @@
};
$.Molequul.prototype._cellsByRowLayout = function( $elems ) {
var instance = this;
var instance = this,
cols = this.cellsByRow.cols;
this.cellsByRow.atomsLen = $elems.length;
$elems.each( function( i ){
var $this = $(this),
x = ( i % instance.cellsByRow.cols ) * instance.cellsByRow.columnWidth
+ instance.posLeft,
y = ~~( i / instance.cellsByRow.cols ) * instance.cellsByRow.rowHeight
+ instance.posTop;
x = ( i % cols + 0.5 ) * instance.cellsByRow.columnWidth
- $this.outerWidth(true) / 2 + instance.posLeft,
y = ( ~~( i / cols ) + 0.5 ) * instance.cellsByRow.rowHeight
- $this.outerHeight(true) / 2 + instance.posTop;
instance._pushPosition( $this, x, y );
});
return this;

Loading…
Cancel
Save