Skip to content

Instantly share code, notes, and snippets.

@swdyh
Created August 23, 2008 20:21
Show Gist options
  • Save swdyh/6938 to your computer and use it in GitHub Desktop.
Save swdyh/6938 to your computer and use it in GitHub Desktop.
Array.forEach(document.images, function(i) {
var pa = i.parentNode
if (pa.rel && pa.rel.match(/^lightbox/)) {
i.src = pa.href
i.style.width = 'auto'
i.style.height = 'auto'
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment