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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -