Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Question about adding Javascript image magnification code.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-28-2009, 06:29 PM
  Brett_H's Avatar 
Brett_H Brett_H is offline
 

Member
  
Join Date: Feb 2009
Posts: 14
 

Default Question about adding Javascript image magnification code.

I found a pretty cool image magnification javascript (link) that I wanted to use in the body (detailed description) of my product pages. Currently I have an image on each of my product pages (in addition to the thumbnail and additional images) and I'd like to be able to use this script to magnify it... it's cool because it doesn't open it in a new window or navigate away from that page, you just click it anywhere to open and click it anywhere to close.

Anyway... I have no idea how or where to insert the code. I have basic HTML knowledge, but that's about it.

These are the instructions that came with the free software:

Quote:
  1. Copy PopBox.js to your scripts directory and reference it in your web pages with a
    <script src="/scripts/PopBox.js" type="text/javascript"></script> tag.
  2. Make changes to the global variables to support your installation directory structure (after the PopBox.js script include): <script type="text/javascript">
    popBoxWaitImage.src = "/images/spinner40.gif";
    popBoxRevertImage = "/images/magminus.gif";
    popBoxPopImage = "/images/magplus.gif";
    </script>
  3. Add any CSS classes you wish to your stylesheet file to help determine the look of your images.
  4. If you are using the magnification glass icons copy them to your images directory and modify their location in your stylesheet accordingly.
  5. Attribute your <img> tags with PopBox events. Instructions can be found on the PopBox product page and the PopBox documentation page.

I'm stuck on the #1. Do I add the code to /customer/main/product.tpl ? If so, where?I know I'm going to have trouble with the rest of the instructions as well.

This script would be great for my site if I could get it to work... any help you guys could give me would be REALLY appreciated.
__________________
4.3.2
Reply With Quote
  #2  
Old 03-30-2009, 01:24 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Question about adding Javascript image magnification code.

You can add this script elsewhere you wish within skin1 dir (in a separate file named PopBox.js).
I think placing it in skin1/customer/ is good idea
Then insert in /customer/main/product.tpl right below the lines
Code:
{/capture} {include file="customer/dialog.tpl" }

Code:
<script src="customer/PopBox.js" type="text/javascript"></script> <script type="text/javascript"> popBoxWaitImage.src = "{$ImagesDir}/spinner40.gif"; popBoxRevertImage = "{$ImagesDir}/magminus.gif"; popBoxPopImage = "{$ImagesDir}/magplus.gif"; </script>

And copy these images in your skin1/images directory

So you complete first and second step
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #3  
Old 08-24-2009, 04:55 AM
 
burko burko is offline
 

Member
  
Join Date: Feb 2009
Posts: 21
 

Default Re: Question about adding Javascript image magnification code.

This looks great. I also have very basic skills.
I would be keen to implement this so that the main image on the product details page is magnified on mouse-over or click.

Any help with where to put the code would be appreciated.

Cheers

Paul
__________________
Paul
www.buyeco.com.au

X-Cart 4.2.3
CDSEo Pro
Marketing Manager Pro3
Reply With Quote
  #4  
Old 08-24-2009, 04:12 PM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: Question about adding Javascript image magnification code.

Check my sig for a link for highslide
__________________
- Shane Munroe
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:09 PM.

   

 
X-Cart forums © 2001-2020