PDA

View Full Version : Image Thumbnail Viewer II open image _BLANK



Ratto84
05-09-2011, 11:54 AM
1) Script Title: Image Thumbnail Viewer II

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

3) Describe problem: When I click on enlarged image its link is opened in target ="_self", I need a new window _blank to open. It is possible? I have not modified the js file and this is my code for each image:

<a href="upload_img/'.$dettagli[2].'" rel="enlargeimage" rev="targetdiv:loadarea,link:upload_img/'.$dettagli[2].', trigger:mouseover" title=""><img src="upload_img/'.$dettagli[2].'" title="" width="160" style="margin-bottom:10px;"/></a>';

I've just read other threads, but they seems not to work.

Thanks for the attenction

Ratto84

ddadmin
05-09-2011, 11:30 PM
Try finding the below line inside the .js file, and add to it the part in red:


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

Ratto84
05-10-2011, 09:40 AM
Thanks for your help, but I've just read this solution in another post, but it doesn't work.:(:mad:
Have you got some other solution? Thanks a lot for your help and attenction!

Ratto84

ddadmin
05-10-2011, 09:00 PM
Hmm works for me. I've attached the modified .js file below.

Ratto84
05-11-2011, 12:58 PM
Thanks DDAdmin, i've tried with you js file, but nothing seems to change. I don't know what to do... I'm not practice in javascript... Have you got some other ideas? Or also an idea of what can make this function not working?

Thanks again for your precious help

Ratto84

ddadmin
05-12-2011, 12:53 AM
Please post a link to the page on your site that contains the with the modified .js file so we can check it out.

Ratto84
05-12-2011, 01:59 PM
The page is this: http://www.guitarplanet.it/new/product.php?ID=120&Prodotto=vedi+dettagli%3E%3E and the js file used is the one you have sent to me. The function that open the full resolution image is activated only for the first image. If you need some other info or details feel you free to ask them.

Thanks a lot,

Ratto84

jscheuer1
05-12-2011, 02:09 PM
That page is still using the unmodified script.

Ratto84
05-15-2011, 05:51 PM
Oh sorry, now the page is using the modified js file. Thanks John

jscheuer1
05-15-2011, 07:05 PM
So, all fixed then? I don't think so. I just checked the page again and as far as I can tell, it's still using the unmodified script.

Even with the unmodified script, it appears as though only the first image has a link property set for it in its rev attribute anyway.

And it:


<a href="upload_img/FENDER_STRATOCASTER_66_firemist_silver_Custom_shop_ltd_1.JPG" rel="enlargeimage" rev="targetdiv:loadarea,link:upload_img/FENDER_STRATOCASTER_66_firemist_silver_Custom_shop_ltd_1.JPG, target="_blank" onclick="" trigger:mouseover" title="">

Has trailing garbage, it should be:


<a href="upload_img/FENDER_STRATOCASTER_66_firemist_silver_Custom_shop_ltd_1.JPG" rel="enlargeimage" rev="targetdiv:loadarea,link:upload_img/FENDER_STRATOCASTER_66_firemist_silver_Custom_shop_ltd_1.JPG" title="">

target and onclick aren't valid properties for either version of the script and the default trigger is mouseover, so that's not needed.

ddadmin
05-15-2011, 07:48 PM
From what I can tell your .js file is still the old one. You can make the changes directly inside this file. Find the line:


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

and change that to:


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

Also looking at the markup for the first thumbnail image on your page, there is a HTML syntax error- the comma in red should be replaced with a closing apostrophe instead:


<a href="upload_img/FENDER_STRATOCASTER_66_firemist_silver_Custom_shop_ltd_1.JPG" rel="enlargeimage" rev="targetdiv:loadarea,link:upload_img/FENDER_STRATOCASTER_66_firemist_silver_Custom_shop_ltd_1.JPG, target="_blank" onclick="" trigger:mouseover" title="">

ddadmin
05-15-2011, 07:49 PM
Hehe looks like you beat me to it John.

jscheuer1
05-15-2011, 10:00 PM
Hehe looks like you beat me to it John.

Yes, but your answer was calmer. :)

I was wondering though, they want the target to be _blank, why do you keep putting _new? I know that allows the browser to reuse the window or tab (generally a good thing), but that's not what they asked for.

Ratto84
05-17-2011, 10:58 AM
Thanks very Much John and DDadmin, but it doesn't seems to work.
Now I've changed the line into the js file and I've correct the HTML error. But nothing change. The script(please look only at the first image, the others aren't clickable) open the image in the same page as the HTML page.

This is the link: http://www.guitarplanet.it/new/product.php?ID=133&Prodotto=vedi+dettagli%3E%3E

Help me again please :)

Thanks to all

jscheuer1
05-17-2011, 03:19 PM
You fixed the rev attribute on the live page, but you're still using the old version of the script.

Ratto84
05-18-2011, 12:43 PM
Oh... Right, thanks! Sorry, i'm an idiot! You're right, i was using the old version... Now i've uploaded the new one, but... now there's a new problem: the image is enlarged also in the page. Take a look.
http://www.guitarplanet.it/new/product.php?ID=143&Prodotto=vedi+dettagli%3E%3E

jscheuer1
05-18-2011, 04:05 PM
That's because you're using the same huge image for the thumbnail and the enlarged image, and the image that shows in the new window. If you want the enlarged image on the page to be smaller, either use a smaller image for that, or put something like so:


#loadarea img {
width: 450px;
}

in your stylesheet.

Ratto84
05-19-2011, 10:37 AM
Thank you very very very very very very much John! My problem is solved. Thanks for your patience.

Ratto84