Results 1 to 5 of 5
  1. #1
    Join Date
    May 2012
    Posts
    137
    Plugin Contributions
    0

    Default New image displayed on mouse over on category page

    On this pages: http://toolsforchrist.com/index.php?...=index&cPath=1

    When someone hovers over one of the images I want it to change to a different image. How can I do this? Can it be done in the product_listing.php file within the array. So it would always diplay an image, for example, where the name of the image is "..._mouseOver.jpg".

    Hopefully I am making sense.

    Thanks
    Corey

  2. #2
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: New image displayed on mouse over on category page

    I would modify the plugin I wrote here:

    http://www.zen-cart.com/downloads.php?do=file&id=1543

  3. #3
    Join Date
    May 2012
    Posts
    137
    Plugin Contributions
    0

    Default Re: New image displayed on mouse over on category page

    This does exactly what I want, but I just cant seem to figure out what everyhting does so that I can modify it for the product description page? Can I just paste this code into the product_listing.php file?

    Thanks for replying.

  4. #4
    Join Date
    May 2012
    Posts
    137
    Plugin Contributions
    0

    Default Re: New image displayed on mouse over on category page

    I think I am close to understanding what I need to do with your code. I believe I need to paste this code into my product_listing.php file and change red code. The only thing I cannot figure out is what that should be changed to.

    Code:
    // bof Rollover modification
    // if xyz.jpg is in the images directory
    // then it will show the xyz.jpg in the images/rollover directory
    // both files MUST have the same name
    
    
    $products_image_medium_rollover = str_replace('images','images/rollover', $products_image_medium);
    
    ?>
    
    <style>
    #productMainImage { 
      background:url("<? echo $products_image_medium_rollover;?>") no-repeat;
      background-size:<?php echo MEDIUM_IMAGE_WIDTH;?>px <?php echo MEDIUM_IMAGE_HEIGHT;?>px;
      background-position:left top;
    }
    #productMainImage a, #productMainImage a:link, #productMainImage a:visited {
      display:block;
    }
    
    #productMainImage a:hover img {
      visibility:hidden;
    }
    </style>
    <?php
    // eof Rollover modification

  5. #5
    Join Date
    May 2012
    Posts
    137
    Plugin Contributions
    0

    Default Re: New image displayed on mouse over on category page

    OK, I have been working on this all day and I feel like I am getting a little closer but I still cannot get it to work. here is what I think I need to do:

    Put this part of the code at the end of the tpl_modules_product_listing.php or the product_listing.php file:
    Code:
    <style>
    #listingProductImage { 
      background:url("<? echo $product_list_image_rollover;?>") no-repeat;
      background-size:<?php echo IMAGE_PRODUCT_LISTING_WIDTH;?>px <?php echo IMAGE_PRODUCT_LISTING_HEIGHT;?>px;
      background-position:left top;
    }
    #listingProductImage a, #listingProductImage a:link, #listingProductImage a:visited {
      display:block;
    }
    
    #listingProductImage a:hover img {
      visibility:hidden;
    }
    </style>
    Now, this is the part I am having trouble with. I cannot figure out where this part of the code goes and exactly what the red code should be. I think I have it right now, but still not sure

    Code:
    $product_list_image_rollover = str_replace('images','images/rollover', $products_image);

 

 

Similar Threads

  1. Image size on mouse over
    By Big Ben in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 7 Nov 2011, 07:25 AM
  2. Mouse over event on image on listing page
    By tallberg in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Aug 2010, 02:19 AM
  3. Image on mouse over?
    By GoranCro in forum General Questions
    Replies: 9
    Last Post: 21 Oct 2009, 07:27 PM
  4. Mouse over larger image
    By Bruce1952 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 11 Sep 2008, 01:47 AM
  5. Custom image mouse over
    By batteryman in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 29 Mar 2007, 06:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR