Marlon Douglas Posted August 3, 2011 Report Share Posted August 3, 2011 Eu tenho o seguinte código:$(document).ready(function() { var dados = []; $('.ok').each(function(i, el){ var id = $(this).attr('id'); var x = $(this).css('margin-top'); var y = $(this).css('margin-left'); }); });Eu quero fazer que inclua no array id, x e y. Como faço? Quote Link to comment Share on other sites More sharing options...
0 fiote Posted August 3, 2011 Report Share Posted August 3, 2011 Pra inserir:dados.push({'id':id,'x':x,'y':y}); Pra acessar: myX = dados[i].x; Quote Link to comment Share on other sites More sharing options...
0 Marlon Douglas Posted August 5, 2011 Author Report Share Posted August 5, 2011 Obrigado :D Quote Link to comment Share on other sites More sharing options...
Question
Marlon Douglas
Eu tenho o seguinte código:
Eu quero fazer que inclua no array id, x e y. Como faço?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.