4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: aedemirci on November 13, 2005, 11:22:16 PM

Title: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 13, 2005, 11:22:16 PM
Hi All,

I read related topics with this problem. One could fix it but no explanation...Here comes the problem. I inserted the lines below {header} tag in details.html.

Here is the code :

<script>

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();      
}}

</script>


and replaced the {image} tag with <a href="javascript:popImage('{media_src}','{width}','{height}')">{thumbnail}</a>...

Finally, I reloaded the page without any Java errors. Nevertheless, the pop-up was not functioning  :roll: :roll: :roll: :roll:

Any possible fixes ??? All the best...
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 13, 2005, 11:29:54 PM
please post the URL to your Gallery please...
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 13, 2005, 11:33:07 PM
http://galeri.yonorg.net

Thx  :D :D :D
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 13, 2005, 11:36:32 PM
please paste the JS over the other JS in the header.html... It musst between the <head> and </head> Tag...
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 13, 2005, 11:40:44 PM
also tried it  :cry: still nothing...  :cry:
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 13, 2005, 11:45:38 PM
please try this:

<a href="javascript:popImage('{media_src}','{image_name}')">{image}</a>
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 13, 2005, 11:49:08 PM
still doesn't work. besides I don't want the real image be seen in the details page. I want a thumbnail on the details page and after clicking on it, visitors should see the real image in a auto-sized pop-up windows... :) :)
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 13, 2005, 11:51:40 PM
then try {thumbnail_openwindow}...  (o:
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 13, 2005, 11:54:08 PM
where should I put that tag ??? is it like this ? 'Cause it didn't work...lol...

<a href="javascript:popImage('{thumbnail_openwindow}','{image_name}','{width}','{height}')">{thumbnail}</a>
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 13, 2005, 11:56:04 PM
try to replace this <a href="javascript:popImage('{thumbnail_openwindow}','{image_name}','{width}','{height}')">{thumbnail}</a> with this {thumbnail_openwindow}... Sorry its very late an my Brain is sleeping... (o:
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 13, 2005, 11:59:22 PM
Sorry...The problem maybe with me :D

Now I replaced {image} tag with {thumbnail_openwindow}...still nothing plus no link on thumbnail anymore :)
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 14, 2005, 12:00:23 AM
okie then i will try to help you tomorrow...
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 14, 2005, 12:01:08 AM
do you want me to send you my details.html ???
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 14, 2005, 12:06:57 AM
no... (o:
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 14, 2005, 12:08:18 AM
ok  :D :D :D :D :D goodnight...
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 14, 2005, 12:08:47 AM
THX...  :D
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 14, 2005, 05:16:38 PM
Any possible solutions yet ? :mrgreen:

By the way, I extracted the codes and tried in a blank HTML and they worked...And that made me more and more nervous  :twisted:

Thx :)
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 14, 2005, 05:22:13 PM
why you dont use the {thumbnail_openwindow} in the thumbnail_bit.html?

Then the Detail Page is opening in a new Window... (o:
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 14, 2005, 05:32:27 PM
But it's not a solution as the new window also contains data. I want people to see only original image...I know I want too much, but that's what I want  :lol:  :lol:  :lol:  :lol:  :lol:
Title: Re: Auto-Sizing Pop-Up for Images
Post by: Acidgod on November 14, 2005, 05:50:00 PM
sorry but thi is only a Javascript request and i dont now the Javascript that you are use... )o:

try this... (o:
Code: [Select]
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>

<a href="#" onclick="MM_openBrWindow('{media_src}','{image_name}','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=100,height=100')">{thumbnail}</a>
Title: Re: Auto-Sizing Pop-Up for Images
Post by: aedemirci on November 14, 2005, 05:57:20 PM
I think this is gonna work after a few minor fixes  :D :D :D Thank you very much indeed (for your patience also)  :oops: :oops: :oops: