Wert aus Funktion auslesen.

Clausmitzeh

Grünschnabel
Der Titel ist ziemlich ungenau, ich weiß...

Für diejenigen die das Masonry-Skript kennen:
https://github.com/desandro/masonry/blob/master/dist/masonry.pkgd.js

Ich möchte bevor eine Positionierung mittels Masonry Skript ausgeführt wird, die errechnete Position als Rückgabewert erhalten. Ich glaube ja ich bekomme den Wert aus dieser Funktion:

Javascript:
Item.prototype._transitionTo = function( x, y ) {
this.getPosition();
// get current x & y from top/left
var curX = this.position.x;
var curY = this.position.y;
var compareX = parseInt( x, 10 );
var compareY = parseInt( y, 10 );
var didNotMove = compareX === this.position.x && compareY === this.position.y;
// save end position
this.setPosition( x, y );
// if did not move and not transitioning, just go to layout
if ( didNotMove && !this.isTransitioning ) {
this.layoutPosition();
return;
}


Kann mir einer von Euch Profis sagen wie ich jetzt den Return-Wert auslesen kann.
Zum Beispiel in einem Alert?
Ich steh echt auf dem Schlauch...

Danke im Voraus.
Claus
 
Zuletzt bearbeitet von einem Moderator:
Zurück