Author Topic: Auto-Sizing Pop-Up for Images  (Read 21630 times)

0 Members and 1 Guest are viewing this topic.

Offline aedemirci

  • Newbie
  • *
  • Posts: 14
    • View Profile
Auto-Sizing Pop-Up for Images
« 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...

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Auto-Sizing Pop-Up for Images
« Reply #1 on: November 13, 2005, 11:29:54 PM »
please post the URL to your Gallery please...

Offline aedemirci

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Auto-Sizing Pop-Up for Images
« Reply #2 on: November 13, 2005, 11:33:07 PM »

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Auto-Sizing Pop-Up for Images
« Reply #3 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...

Offline aedemirci

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Auto-Sizing Pop-Up for Images
« Reply #4 on: November 13, 2005, 11:40:44 PM »
also tried it  :cry: still nothing...  :cry:

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Auto-Sizing Pop-Up for Images
« Reply #5 on: November 13, 2005, 11:45:38 PM »
please try this:

<a href="javascript:popImage('{media_src}','{image_name}')">{image}</a>

Offline aedemirci

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Auto-Sizing Pop-Up for Images
« Reply #6 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... :) :)

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Auto-Sizing Pop-Up for Images
« Reply #7 on: November 13, 2005, 11:51:40 PM »
then try {thumbnail_openwindow}...  (o:

Offline aedemirci

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Auto-Sizing Pop-Up for Images
« Reply #8 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>

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Auto-Sizing Pop-Up for Images
« Reply #9 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:

Offline aedemirci

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Auto-Sizing Pop-Up for Images
« Reply #10 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 :)

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Auto-Sizing Pop-Up for Images
« Reply #11 on: November 14, 2005, 12:00:23 AM »
okie then i will try to help you tomorrow...

Offline aedemirci

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Auto-Sizing Pop-Up for Images
« Reply #12 on: November 14, 2005, 12:01:08 AM »
do you want me to send you my details.html ???

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Auto-Sizing Pop-Up for Images
« Reply #13 on: November 14, 2005, 12:06:57 AM »
no... (o:

Offline aedemirci

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Auto-Sizing Pop-Up for Images
« Reply #14 on: November 14, 2005, 12:08:18 AM »
ok  :D :D :D :D :D goodnight...