Forums / All Other Contributions/Addons / Image Swap via Javascript

Image Swap via Javascript

Views: 22,848

Results 41 to 60 of 95
18 Jul 2007, 9:46 PM
#41
damicron avatar

damicron

New Zenner

Join Date:
Apr 2006
Posts:
11
Plugin Contributions:
0

Image Swap via Javascript

it is not working correctly. The mod info says it should find the medium img if its there.
I would really like see this working
What I'm trying to do is use this for swatches by creating small colored swatches,20x20, and naming it the alt image small file name, which would then replace the product image with the MED colored image when hovered over.
For the moment it works as a pop window but it would be much cleaner to replace the main image.

Im not a programmer, but is it possible to call the script manually by inputing code for swatches you create in html in the description field of the product? Could you swap the main image directly to the MED alt file name? It takes more work but i think it could make cleaner swatch.

26 Sep 2007, 9:02 PM
#42
rvagrrl avatar

rvagrrl

New Zenner

Join Date:
Oct 2005
Posts:
90
Plugin Contributions:
0

Re: Image Swap via Javascript

Any chance someone's been able to get this working with Image Handler? Thanks!

13 Nov 2007, 4:31 PM
#43
beatmaker avatar

beatmaker

New Zenner

Join Date:
May 2007
Posts:
91
Plugin Contributions:
0

Re: Image Swap via Javascript

Same here. Anybody know if IH2 and Image Swap play nice now or what? I already have IH2 installed... was about to install Image Swap when I searched for any issues. Please advise. Thanks.

7 May 2008, 1:20 AM
#44
maitaijim avatar

maitaijim

New Zenner

Join Date:
May 2008
Posts:
37
Plugin Contributions:
0

Re: Image Swap via Javascript

firefly:

Yeah, I've had to revert to the default. The trouble is that the using _MED images for both additional images thumbnails and corresponding medium sized images is that the thumbnails look terrible. They're not distorted, but just look really bad quality.
Turns out it was just a typo that caused this mod to not work correctly.
Fixed - **http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=311**

9 May 2008, 6:16 AM
#45
starrydesigns avatar

starrydesigns

New Zenner

Join Date:
Feb 2008
Location:
Singapore
Posts:
22
Plugin Contributions:
0

Re: Image Swap via Javascript

I am having a problem with the add-on. It is working as per normal, except when I move the mouse away, it doesn't display the initial first image. Does anyone know of a solution to this?

Thanks in advance for all help!

9 May 2008, 6:52 AM
#46
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Image Swap via Javascript

Working in dark not easy.. url of your site is?

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

9 May 2008, 9:06 AM
#47
starrydesigns avatar

starrydesigns

New Zenner

Join Date:
Feb 2008
Location:
Singapore
Posts:
22
Plugin Contributions:
0

Re: Image Swap via Javascript

My site is not ready yet. But I can show an example from the website of the wonderful Paper Princess.

http://www.thepaperprincess.com/index.php?main_page=product_info&cPath=4_21&products_id=82

Notice when you mouseover on the item and then mouseout, the original image shows again on the main image window. For mine, the selected image (when I first mouseover) remains when I mouseout. It does not swap back to the original image.

Hopefully my explanation is clear! :D

9 May 2008, 9:29 AM
#48
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Image Swap via Javascript

My site is not ready yet.
Ok but without viewing what is happening on your actual
zencart site, can only advise to recheck that you have installed mod as per instructions and all
its files are in correct folders.. especially javascript files.

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

10 May 2008, 5:35 PM
#52
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Image Swap via Javascript

starrydesigns:

Thanks so much!
I understand, from your PM to myself, that you have managed to fix problem
with Swap Images via MouseOver module.. could you share how...
will help other zencart members/users having similar problem.
:smile:

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

11 May 2008, 9:27 AM
#53
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Image Swap via Javascript

Swap images via mouseover mod..VERSION for zencart 1.3.8..

**ZenCart 1.3.8 **

FIX provided by starrydesigns

Replace file included in mod i.e.
/includes/modules/NAMEOFYOURTEMPLATE/additional_images.php
with one below

<?php
/**
 * additional_images module
 *
 * Prepares list of additional product images to be displayed in template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license [URL]http://www.zen-cart.com/license/2_0.txt[/URL] GNU Public License V2.0
 * @version $Id: additional_images.php 6132 2007-04-08 06:58:40Z drbyte $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
if (!defined('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE')) define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','Yes');
if (!defined('TEXT_CLICK_TO_CHANGE')) define('TEXT_CLICK_TO_CHANGE','Preview');
if ($products_image != '') {
  // prepare image name
  $products_image_extension = substr($products_image, strrpos($products_image, '.'));
  $products_image_base = str_replace($products_image_extension, '', $products_image);
  // if in a subdirectory
  if (strrpos($products_image, '/')) {
    $products_image_match = substr($products_image, strrpos($products_image, '/')+1);
    //echo 'TEST 1: I match ' . $products_image_match . ' - ' . $file . ' -  base ' . $products_image_base . '<br>';
    $products_image_match = str_replace($products_image_extension, '', $products_image_match) . '_';
    $products_image_base = $products_image_match;
  }
  $products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
  if ($products_image_directory != '') {
    $products_image_directory = DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/";
  } else {
    $products_image_directory = DIR_WS_IMAGES;
  }
  // Check for additional matching images
  $file_extension = $products_image_extension;
  $products_image_match_array = array();
  if ($dir = @dir($products_image_directory)) {
    while ($file = $dir->read()) {
      if (!is_dir($products_image_directory . $file)) {
        if (substr($file, strrpos($file, '.')) == $file_extension) {
          //          if(preg_match("/" . $products_image_match . "/i", $file) == '1') {
          if(preg_match("/" . $products_image_base . "/i", $file) == 1) {
            if ($file != $products_image) {
              if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {
                //  echo 'I AM A MATCH ' . $file . '<br>';
                $images_array[] = $file;
              } else {
                //  echo 'I AM NOT A MATCH ' . $file . '<br>';
              }
            }
          }
        }
      }
    }
    if (sizeof($images_array)) {
      sort($images_array);
    }
    $dir->close();
  }
}
// Build output based on images found
$num_images = sizeof($images_array);
$list_box_contents = '';
$title = '';
if ($num_images) {
  $row = 0;
  $col = 0;
  if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) {
    $col_width = floor(100/$num_images);
  } else {
    $col_width = floor(100/IMAGES_AUTO_ADDED);
  }
$org_product_image =$products_image_medium;
  for ($i=0, $n=$num_images; $i<$n; $i++) {
    $file = $images_array[$i];
    $products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
    $flag_has_large = file_exists($products_image_large);
    $products_image_large = ($flag_has_large ? $products_image_large : $products_image_directory . $file);
    $flag_display_large = (IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large);
    $base_image = $products_image_directory . $file;
    $thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);
    $products_image_medium = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'medium/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_MEDIUM . $products_image_extension;
    if (!file_exists($products_image_medium)) { //use small if not found
      $products_image_medium = $products_image_directory . $file;
    }
//$products_image_large_additional = $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
//set some defaults
  $img_large='';
  $ahref_start = '<a';
  $ahref_end = '>';
  $ahref_close = '</a>';
  $img_thumb   = zen_image($products_image_directory . $file, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
  $swap_image = $products_image_directory . $file; //small unless medium found
  $enlarge_text = '<br />';
  if (file_exists($products_image_medium)) {
    //onMouseOver or onClick only valid with small or medium images... no point loading huge "large" images for display in small space
    $noscript_href = $products_image_medium;
    $swap_image = $products_image_medium;
    $img_large = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_medium);
    $enlarge_text='<br />' . TEXT_CLICK_TO_ENLARGE;
  }
  if (file_exists($products_image_large)) {
    $noscript_href = $products_image_large;
    $img_large = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);
    $enlarge_text='<br />' . TEXT_CLICK_TO_ENLARGE;
  }
  $script_href = ' href="'.$img_large.'"';
  if (PRODUCT_IMAGE_SWAP_ON_ROLLOVER=='true') {
    $onMouseOver = ' onMouseOver="return(swapImage(\\\''.$swap_image.'\\\'))" onMouseOut="return(swapImage(\\\''.$org_product_image.'\\\'))" ';
    if (PRODUCT_IMAGE_SWAP_ON_CLICK !='true') $enlarge_text='';
    if (zen_not_null($img_large)) $script_href = ' href="javascript:popupWindow(\\\'' . $img_large . '\\\')"';
  }
  if (PRODUCT_IMAGE_SWAP_ON_CLICK=='true') {
    $onClick = ' onClick="return(swapImage(\\\''.$swap_image.'\\\' ))"';
    if (PRODUCT_IMAGE_SWAP_ON_ROLLOVER !='true') $enlarge_text='';
    $script_href = '';
  }
  if (PRODUCT_IMAGE_SWAP_ON_CLICK !='true' && PRODUCT_IMAGE_SWAP_ON_ROLLOVER !='true') { //if events disabled, make click-to-enlarge
    if (zen_not_null($img_large)) $script_href = ' href="javascript:popupWindow(\\\'' . $img_large . '\\\')"';
  }
 
    // Link Preparation:
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . $ahref_start . $script_href . $onClick . $onMouseOver . $ahref_end . $img_thumb . $enlarge_text . $ahref_close . '\');' . "\n" . '//--></' . 'script>';
  if (zen_not_null($noscript_href)) {
    $ahref_start = '<a href="';
    $ahref_end = '" target="_blank">';
    $ahref_close = '</a>';
  } else {
    $ahref_start = '';
    $ahref_end = '';
    $ahref_close = '';
  }
    $noscript_link = '<noscript>' . $ahref_start . $noscript_href . $ahref_end . $img_thumb . $enlarge_text . $ahref_close . '</noscript>';
    $link = $script_link . "\n      " . $noscript_link;
    //      $link = $alternate_link;
    // List Box array generation:
    $list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => "\n      " . $link);
    $col ++;
    if ($col > (IMAGES_AUTO_ADDED -1)) {
      $col = 0;
      $row ++;
    }
  } // end for loop
} // endif
?>

Tested, works fine...
AS ALWAYS.. BACKUP FILES BEFORE ALTERING

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

11 May 2008, 1:26 PM
#54
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,187
Plugin Contributions:
0

Re: Image Swap via Javascript

Misty,
Thanks for the update on this situation.
Very, very helpful :smile:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

12 May 2008, 8:44 PM
#56
maitaijim avatar

maitaijim

New Zenner

Join Date:
May 2008
Posts:
37
Plugin Contributions:
0

Re: Image Swap via Javascript

misty:

Swap images via mouseover mod..VERSION for zencart 1.3.8..

**ZenCart 1.3.8 **

FIX provided by starrydesigns

Replace file included in mod i.e.
/includes/modules/NAMEOFYOURTEMPLATE/additional_images.php
with one below
---snip--
Tested, works fine...
AS ALWAYS.. BACKUP FILES BEFORE ALTERING

SWEET you added onMouseOut functionality!
I thought I was excited last week when I corrected the "$products_image_extention" problem (I don't know a lick of PHP).
Will you be submitting this to the downloads?

Now if some one could get this Image Swap mod working with Image Handler 2 we would sitting pretty! I gave it a go but stuck trying to figure out how to stop IH2 from stripping the $parameters out of zen_image()?
I'm fairly certain it's happening in "/includes/classes/bmz_image_handler.class.php" starting arorund line 675?

Jim

12 May 2008, 9:19 PM
#57
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Image Swap via Javascript

Will you be submitting this to the downloads?
Already in downloads section.. just requires this one amended file
be substituted for existing. Also not my creation i.e.
FIX provided by starrydesigns

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

13 May 2008, 9:39 PM
#58
maitaijim avatar

maitaijim

New Zenner

Join Date:
May 2008
Posts:
37
Plugin Contributions:
0

Re: Image Swap via Javascript

I took starrydesigns addition of onMouseOut functionality one step further and made it switchable.

If you would like for the original image to return when you move the mouse away set 'PRODUCT_IMAGE_SWAP_ONMOUSEOUT' in /includes/extra_configures/rollover_defines.php to 'true'.

I updated the readme.txt and submitted it to the downloads. I attached it here also.

Jim

13 May 2008, 10:05 PM
#59
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Image Swap via Javascript

I updated the readme.txt and submitted it to the downloads. I attached it here also.
Thank You
:clap:

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

13 May 2008, 11:44 PM
#60
maitaijim avatar

maitaijim

New Zenner

Join Date:
May 2008
Posts:
37
Plugin Contributions:
0

Re: Image Swap via Javascript

Unfortunately I didn't think of this until after I submitted it to the downloads. This version of /includes/modules/YOURTEMPLATE/additional_images.php will preload the swap images.

<?php
/**
 * additional_images module
 *
 * Prepares list of additional product images to be displayed in template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: additional_images.php 6132 2007-04-08 06:58:40Z drbyte $
 *
 * onMouseOut functionality provided by starrydesigns
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
if (!defined('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE')) define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','Yes');
if (!defined('TEXT_CLICK_TO_CHANGE')) define('TEXT_CLICK_TO_CHANGE','Preview');
if ($products_image != '') {
  // prepare image name
  $products_image_extension = substr($products_image, strrpos($products_image, '.'));
  $products_image_base = str_replace($products_image_extension, '', $products_image);
  // if in a subdirectory
  if (strrpos($products_image, '/')) {
    $products_image_match = substr($products_image, strrpos($products_image, '/')+1);
    //echo 'TEST 1: I match ' . $products_image_match . ' - ' . $file . ' -  base ' . $products_image_base . '<br>';
    $products_image_match = str_replace($products_image_extension, '', $products_image_match) . '_';
    $products_image_base = $products_image_match;
  }
  $products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
  if ($products_image_directory != '') {
    $products_image_directory = DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/";
  } else {
    $products_image_directory = DIR_WS_IMAGES;
  }
  // Check for additional matching images
  $file_extension = $products_image_extension;
  $products_image_match_array = array();
  if ($dir = @dir($products_image_directory)) {
    while ($file = $dir->read()) {
      if (!is_dir($products_image_directory . $file)) {
        if (substr($file, strrpos($file, '.')) == $file_extension) {
          //          if(preg_match("/" . $products_image_match . "/i", $file) == '1') {
          if(preg_match("/" . $products_image_base . "/i", $file) == 1) {
            if ($file != $products_image) {
              if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {
                //  echo 'I AM A MATCH ' . $file . '<br>';
                $images_array[] = $file;
              } else {
                //  echo 'I AM NOT A MATCH ' . $file . '<br>';
              }
            }
          }
        }
      }
    }
    if (sizeof($images_array)) {
      sort($images_array);
    }
    $dir->close();
  }
}
// Build output based on images found
$num_images = sizeof($images_array);
$list_box_contents = '';
$title = '';
if ($num_images) {
  $row = 0;
  $col = 0;
  if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) {
    $col_width = floor(100/$num_images);
  } else {
    $col_width = floor(100/IMAGES_AUTO_ADDED);
  }
$org_product_image =$products_image_medium;
  for ($i=0, $n=$num_images; $i<$n; $i++) {
    $file = $images_array[$i];
    $products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
    $flag_has_large = file_exists($products_image_large);
    $products_image_large = ($flag_has_large ? $products_image_large : $products_image_directory . $file);
    $flag_display_large = (IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large);
    $base_image = $products_image_directory . $file;
    $thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);
    $products_image_medium = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'medium/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_MEDIUM . $products_image_extension;
    if (!file_exists($products_image_medium)) { //use small if not found
      $products_image_medium = $products_image_directory . $file;
    }
//$products_image_large_additional = $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
//set some defaults
  $img_large='';
  $ahref_start = '<a';
  $ahref_end = '>';
  $ahref_close = '</a>';
  $img_thumb   = zen_image($products_image_directory . $file, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
  $swap_image = $products_image_directory . $file; //small unless medium found
  $enlarge_text = '<br />';
  if (file_exists($products_image_medium)) {
    //onMouseOver or onClick only valid with small or medium images... no point loading huge "large" images for display in small space
    $noscript_href = $products_image_medium;
    $swap_image = $products_image_medium;
    $img_large = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_medium);
    $enlarge_text='<br />' . TEXT_CLICK_TO_ENLARGE;
  }
  if (file_exists($products_image_large)) {
    $noscript_href = $products_image_large;
    $img_large = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);
    $enlarge_text='<br />' . TEXT_CLICK_TO_ENLARGE;
  }
  $script_href = ' href="'.$img_large.'"';
  if (PRODUCT_IMAGE_SWAP_ON_ROLLOVER=='true') {
     if (PRODUCT_IMAGE_SWAP_ONMOUSEOUT=='true') {
    $onMouseOver = ' onMouseOver="return(swapImage(\\\''.$swap_image.'\\\'))" onMouseOut="return(swapImage(\\\''.$org_product_image.'\\\'))" ';
    } else {
    $onMouseOver = ' onMouseOver="return(swapImage(\\\''.$swap_image.'\\\'))"';  
    }
    if (PRODUCT_IMAGE_SWAP_ON_CLICK !='true') $enlarge_text='';
    if (zen_not_null($img_large)) $script_href = ' href="javascript:popupWindow(\\\'' . $img_large . '\\\')"';
  }
  if (PRODUCT_IMAGE_SWAP_ON_CLICK=='true') {
    $onClick = ' onClick="return(swapImage(\\\''.$swap_image.'\\\' ))"';
    if (PRODUCT_IMAGE_SWAP_ON_ROLLOVER !='true') $enlarge_text='';
    $script_href = '';
  }
  if (PRODUCT_IMAGE_SWAP_ON_CLICK !='true' && PRODUCT_IMAGE_SWAP_ON_ROLLOVER !='true') { //if events disabled, make click-to-enlarge
    if (zen_not_null($img_large)) $script_href = ' href="javascript:popupWindow(\\\'' . $img_large . '\\\')"';
  }
 
   $img_preload = zen_image($swap_image, '', '', '', 'style="display:none"');
    // Link Preparation:
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . $ahref_start . $script_href . $onClick . $onMouseOver . $ahref_end . $img_thumb . $img_preload . $enlarge_text . $ahref_close . '\');' . "\n" . '//--></' . 'script>';
  if (zen_not_null($noscript_href)) {
    $ahref_start = '<a href="';
    $ahref_end = '" target="_blank">';
    $ahref_close = '</a>';
  } else {
    $ahref_start = '';
    $ahref_end = '';
    $ahref_close = '';
  }
    $noscript_link = '<noscript>' . $ahref_start . $noscript_href . $ahref_end . $img_thumb .  $enlarge_text . $ahref_close . '</noscript>';
    $link = $script_link . "\n      " . $noscript_link;
    //      $link = $alternate_link;
    // List Box array generation:
    $list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => "\n      " . $link);
    $col ++;
    if ($col > (IMAGES_AUTO_ADDED -1)) {
      $col = 0;
      $row ++;
    }
  } // end for loop
} // endif
?>

This was accomplished using the CSS display="none" property. It should work in all browsers but I have not tested this.

Jim