Skip to content

Instantly share code, notes, and snippets.

@vitqst
Created May 25, 2017 17:09
Show Gist options
  • Save vitqst/536ecee9f8da3e61bb7872168eff9956 to your computer and use it in GitHub Desktop.
Save vitqst/536ecee9f8da3e61bb7872168eff9956 to your computer and use it in GitHub Desktop.
var srcImg = $('#allsizes-photo').children('img').attr('src');
var nowUrl = window.location.href;
if(nowUrl.indexOf('sizes/k') > 0){
if(typeof srcImg !== 'undefined'){
openInNewTab(srcImg);
}
}
function openInNewTab(url) {
var win = window.open(url, '_blank');
win.focus();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment