Skip to content

Instantly share code, notes, and snippets.

@gumayunov
Created June 4, 2009 06:56
Show Gist options
  • Save gumayunov/123478 to your computer and use it in GitHub Desktop.
Save gumayunov/123478 to your computer and use it in GitHub Desktop.
var photos = $(document).getElementsByClassName('user_photo');
$A(photos).each( function(e){
var gift = gifts[e.readAttribute('user_id')];
if(!gift) return;
var oy = e.getHeight() - gift['offset_y'], ox = 0 - gift['offset_x'];
var gi = new Element('img', {'class':'gift',
'height':'29px','width':'40px',
'style':'position:absolute;margin-top:'+oy+'px;margin-left:'+ox+'px;'
});
gi.src = gift['url'];
gi.png_fix();
Element.insert(e, {top:gi});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment