FireBot

jquery-object-specific-value

Nov 10th, 2014
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {step: function(){
  2.     var id = $(this).attr('id');
  3.     var pos = $(this).position();
  4.     var posRight = pos.left + $(this).width();
  5.     var posBottom = pos.top + $(this).height();
  6.                
  7.     var xCenter = posRight / 2;
  8.     var yCenter = posBottom / 2;       
  9.  
  10.     $('#' + id).data( 'test', { x: xCenter, y: yCenter } );
  11.     console.log($('#orb1').data( 'test' ).x)
  12. }
Advertisement
Add Comment
Please, Sign In to add comment