Skip to content

Instantly share code, notes, and snippets.

@iwinux
Created April 24, 2012 06:19
Show Gist options
  • Save iwinux/2477074 to your computer and use it in GitHub Desktop.
Save iwinux/2477074 to your computer and use it in GitHub Desktop.
display caoliu images without opening new windows
(function () {
var i, current, src, elem;
var container = $$('.tpc_content')[0];
var inputs = $$('.tpc_content input');
for (i = 0; i < inputs.length; i++) {
current = inputs[i];
src = current.onclick
.toString()
.match(/open\(".*"\)/)[0]
.replace(/open\("(.*)"\)/, '$1');
elem = document.createElement('iframe');
elem.src = src;
elem.width = '1200';
elem.height = '800';
elem.scrolling = 'no';
elem.frameborder = '0';
container.removeChild(current);
container.appendChild(elem);
}
})();
@parano
Copy link

parano commented May 8, 2012

= =!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment