PDA

View Full Version : Thumbnail Viewer II _blank



europe451
01-26-2011, 05:39 PM
1) Script Title: Image Thumbnail Viewer II

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex4/thumbnail2.htm

3) Describe problem: This might be a stupid question but the problem I am having is when the link is clicked the new window is open on _self. I need a new window _blank to open, but I just can't seem to get the code to work.


<a href="/img/films/Crude.jpg" rel="enlargeimage" rev="targetdiv:filmloadarea, link:http://www.amazon.com/Crude-Pablo-Fajardo/dp/B002N7W3IA/ref=sr_1_1?s=dvd&ie=UTF8&qid=1291869222&sr=1-1"><img src="/img/films/thumb_Crude.jpg" /></a>

That is what I have right now. With some help from before I now have it where when clicked the thumbnail or enlarged image both go to the specified link. Though as you read above I am having a problem getting the link to open in a _blank window. Any help?

ddadmin
01-26-2011, 10:33 PM
Try finding the below line inside the .js file:


imghtml='<a href="'+setting.link+'">'+imghtml+'</a>'

and change that to:


imghtml='<a href="'+setting.link+'" target="_new">'+imghtml+'</a>'

europe451
01-27-2011, 11:28 PM
Thanks.

That worked for the enlarged image.

If I am using this script:


<script type="text/javascript">
jQuery(function($){
var re = /:(?!\/\/)/;
$('a[rel=enlargeimage]').click(function(e){
var opts = {}, rev = this.rev.split(','), i = rev.length - 1;
for (i; i > -1; --i){
rev[i] = rev[i].split(re);
opts[$.trim(rev[i][0])] = $.trim(rev[i][1]);
if(opts.link){
e.preventDefault();
location.href = opts.link;
return;
}
}
});
});
</script>
to get the tumbnails to go to the link like the enlarged image, how would I go about getting the thumbs to open in a _new tab as well?

europe451
01-30-2011, 07:18 PM
*bump*