Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 01-11-2004 12:33:05

Divided
Member
Registered: 01-10-2004
Posts: 5

Xlarge Popup Custom Fit To Image Size?

I know I can specify the size of the popup and then resize the images to that one size, but I would like to set it up so the popup automatically fits itself to the image's size.

I went through pages of search results and couldn't find much on this, anyone know if this is possible?  Thanks.

Offline

 

#2 01-11-2004 13:11:39

scoutch
Banned
Registered: 07-03-2003
Posts: 3167

Re: Xlarge Popup Custom Fit To Image Size?

Read this thread :



I'm sure this will answer to your question. smile


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#3 01-13-2004 07:49:49

Divided
Member
Registered: 01-10-2004
Posts: 5

Re: Xlarge Popup Custom Fit To Image Size?

What I'm aiming to do is exactly what WayneK has done .  The popups automatically fit themselves to the image's size.

I even tried the code he posted in the thread above, but I couldn't get it to work the way he did.  Can someone help me with this before I message WayneK?  Thanks.

Offline

 

#4 01-14-2004 17:41:35

Divided
Member
Registered: 01-10-2004
Posts: 5

Re: Xlarge Popup Custom Fit To Image Size?

bump

Is this possible without using Image Magick?

Offline

 

#5 01-14-2004 17:44:44

scoutch
Banned
Registered: 07-03-2003
Posts: 3167

Re: Xlarge Popup Custom Fit To Image Size?

There will be no effect if you apply this MOD without image magik.


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#6 01-14-2004 18:25:21

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Xlarge Popup Custom Fit To Image Size?

You'd need to use Image Magik as that's the only module I know of that will allow you to get the size for an image via Perl.


Nick Hendler

Offline

 

#7 01-14-2004 21:34:08

Divided
Member
Registered: 01-10-2004
Posts: 5

Re: Xlarge Popup Custom Fit To Image Size?

I've found a solution that doesn't require Image Magick!

It was mentioned in this thread:

Works beautifully.  I replaced a couple of things in the script with CCP variables, like automatically inserting the product_name in the title.  Try it out... works great!  All I had to do was replace the element "Extra Large Product Image Link (ste_prdlg_popup)"  with this:

<!--begin here-->

<script language="Javascript">

PositionX = 200;
PositionY = 200;

defaultWidth  = 720;
defaultHeight = 720;

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>

<a href="javascript:popImage('(CGIVAR)popup_image_url(/CGIVAR)','(CGIVAR)product_name(/CGIVAR)')">
<img src="(CGIVAR)image_url(/CGIVAR)" WIDTH="(CGIVAR)store_large_image_width(/CGIVAR)" BORDER="0">
</a>

<!--end-->

Offline

 

#8 01-14-2004 21:54:00

thekiko
Member
Registered: 07-11-2002
Posts: 126

Re: Xlarge Popup Custom Fit To Image Size?

Has anyone tested this script with Safari?  I can't seem to get it to work in Safari based on the demo here

Thanks,
Thekiko


TheKiko

Offline

 

#9 01-14-2004 22:06:19

scoutch
Banned
Registered: 07-03-2003
Posts: 3167

Re: Xlarge Popup Custom Fit To Image Size?

In this case, you might want to try this one :


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

Board footer