underscore.js - Get coordinates of jquery element array -
i want extract array of left coordinates (simply numbers) matched jquery array. similar this:
var array = element.nextall().position().left
is there neat way of doing this, perhaps underscore?
so in case jquery array contains number of divs, each of them want jquery position()
- object , extract left coordinate. resulting array
contain numbers each of div's left coordinate.
please try code:
array = $(element.nextall()).map(function() { return $(this).position().left; }).get();
please refer link
Comments
Post a Comment