Skip to content

Instantly share code, notes, and snippets.

@awentzonline
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save awentzonline/8d877d3d861dde17dff1 to your computer and use it in GitHub Desktop.

Select an option

Save awentzonline/8d877d3d861dde17dff1 to your computer and use it in GitHub Desktop.
$('img').each(function (i, el) {
var elImg = $(el);
var offset = elImg.offset();
var bimg = $('<img>');
bimg.attr(
'src',
'http://rs201.pbsrc.com/albums/aa137/angelsuejones23/f_ed80a26488.gif~c200'
);
bimg.css({
position: 'absolute',
top: offset.top,
left: offset.left,
width: elImg.css('width'),
height: elImg.css('height'),
zIndex: 2
});
$(document.body).append(bimg);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment