Results 1 to 4 of 4

Thread: Thumbnail Viewer II _blank

  1. #1
    Join Date
    Apr 2010
    Posts
    58
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Thumbnail Viewer II _blank

    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.

    HTML Code:
    <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?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try finding the below line inside the .js file:

    Code:
    imghtml='<a href="'+setting.link+'">'+imghtml+'</a>'
    and change that to:

    Code:
    imghtml='<a href="'+setting.link+'" target="_new">'+imghtml+'</a>'
    DD Admin

  3. #3
    Join Date
    Apr 2010
    Posts
    58
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    Thanks.

    That worked for the enlarged image.

    If I am using this script:

    HTML Code:
    <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?

  4. #4
    Join Date
    Apr 2010
    Posts
    58
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    *bump*

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •