I'm struggling to return an array from a function call - code below:
///////////// Generic Functions
function spotJoinPosition() {
var pos = {
offset: $('div#spotJoinSite').offset(),
width: $('div#spotJoinSite').width(),
height: $('div#spotJoinSite').height()
}
return(pos);
}
var positionData = spotJoinPosition();
alert(positionData);
alert(positionData[width]);
When I alert positionData I get [object][object] and then undefined.
Advice?