Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38
  1. #21
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Hard to word it, sry.

    I'm trying to kill the space to the right of product images in screenshot.
    Name:  Screen Shot 2016-03-27 at 8.24.54 PM.png
Views: 153
Size:  81.7 KB

    My additional images are set to 50px max. I'd like this thing to increase width of ".responsive" by 60px (50px for image, plus 10px margin-right) per each additional product image. So before it hits the forth image (triggering slider button), it would max out at 180px (3 images @ 60px).

    Make sense?

    Btw, I have decided to figure out how to kill the left button.
    Last edited by Feznizzle; 28 Mar 2016 at 01:38 AM. Reason: oh yeah

  2. #22
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: JS/CSS thumbnail slider for additional images

    Make these changes first, this basically only adds <div class="responsive"> if more than 3 additional images

    PHP Code:
    <?php
    /**
     * Module Template:
     * Loaded by product-type template to display additional product images.
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 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: tpl_modules_additional_images.php 3215 2006-03-20 06:05:55Z birdbrain $
     * 
     */

     
    require(DIR_WS_MODULES zen_get_module_directory('additional_images.php'));

     if (
    $num_images 3) {
     echo 
    '<div class="responsive">';
     }

     if (
    $flag_show_product_info_additional_images != && $num_images 0) {

    if (
    is_array($list_box_contents) > ) {
     for(
    $row=0;$row<sizeof($list_box_contents);$row++) {
        
    $params "";
        
    //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];

        
    for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
          
    $r_params "";
          if (isset(
    $list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
         if (isset(
    $list_box_contents[$row][$col]['text'])) {

    echo 
    '<div>' $list_box_contents[$row][$col]['text'] .  '</div>'


          }
        }
      }
    }

      }

     if (
    $num_images 3) {
     echo 
    '</div>';
     }

    ?>

  3. #23
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Crud, I deleted my back up tpl_modules_additional_images.php from right before you gave me the new code!

    Anyway, I had my js inside of that file. Not sure how I had it cuz I can't seem to replicate it now.

    Below is the last way I tried it. Breaks the page. Can you show me how to work it back in?


    PHP Code:

    <?php 
    /** 
     * Module Template: 
     * Loaded by product-type template to display additional product images. 
     * 
     * @package templateSystem 
     * @copyright Copyright 2003-2005 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: tpl_modules_additional_images.php 3215 2006-03-20 06:05:55Z birdbrain $ 
     *  
     */ 

     
    require(DIR_WS_MODULES zen_get_module_directory('additional_images.php')); 

     if (
    $num_images 3) { 
     echo 
    '<div class="responsive">'
     
     
     <
    script type="text/javascript">
    (function($) {
    $(
    document).ready(function() {

    $(
    '.responsive').slick({
    dotsfalse,
    infinitetrue,
    speed300,
    slidesToShow3,
    slidesToScroll3,
    responsive: [
    {
    breakpoint1024,
    settings: {
    slidesToShow3,
    slidesToScroll3,
    infinitetrue,
    dotstrue
    }
    },
    {
    breakpoint600,
    settings: {
    slidesToShow1,
    slidesToScroll1
    }
    },
    {
    breakpoint480,
    settings: {
    slidesToShow1,
    slidesToScroll1
    }
    }
    // You can unslick at a given breakpoint now by adding:
    // settings: "unslick"
    // instead of a settings object
    ]
    });

    });

    }) (
    jQuery);
    </script>
     
     
     
     } 

     if ($flag_show_product_info_additional_images != 0 && $num_images > 0) { 

    if (is_array($list_box_contents) > 0 ) { 
     for($row=0;$row<sizeof($list_box_contents);$row++) { 
        $params = ""; 
        //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params']; 

        for($col=0;$col<sizeof($list_box_contents[$row]);$col++) { 
          $r_params = ""; 
          if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params']; 
         if (isset($list_box_contents[$row][$col]['text'])) { 

    echo '<div>' . $list_box_contents[$row][$col]['text'] .  '</div>';  


          } 
        } 
      } 


      } 

     if ($num_images > 3) { 
     echo '</div>'; 
     } 

    ?>

  4. #24
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: JS/CSS thumbnail slider for additional images

    unless you have something other than what I can see in this file just copy my code and paste it in

    PHP Code:
     <?php
    /**
     * Module Template:
     * Loaded by product-type template to display additional product images.
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 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: tpl_modules_additional_images.php 3215 2006-03-20 06:05:55Z birdbrain $
     * 
     */

     
    require(DIR_WS_MODULES zen_get_module_directory('additional_images.php'));

     if (
    $flag_show_product_info_additional_images != && $num_images 0) {

     if (
    $num_images 3) {
     echo 
    '<div class="responsive">';
     }

    if (
    is_array($list_box_contents) > ) {
     for(
    $row=0;$row<sizeof($list_box_contents);$row++) {
        
    $params "";
        
    //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];

        
    for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
          
    $r_params "";
          if (isset(
    $list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
         if (isset(
    $list_box_contents[$row][$col]['text'])) {

    echo 
    '<div>' $list_box_contents[$row][$col]['text'] .  '</div>'


          }
        }
      }
    }

     if (
    $num_images 3) {
     echo 
    '</div>';
     }

      }
    ?> 

    <script type="text/javascript">
    (function($) {
    $(document).ready(function() {

    $('.responsive').slick({
    dots: false,
    infinite: true,
    speed: 300,
    slidesToShow: 3,
    slidesToScroll: 3,
    responsive: [
    {
    breakpoint: 1024,
    settings: {
    slidesToShow: 3,
    slidesToScroll: 3,
    infinite: true,
    dots: true
    }
    },
    {
    breakpoint: 600,
    settings: {
    slidesToShow: 1,
    slidesToScroll: 1
    }
    },
    {
    breakpoint: 480,
    settings: {
    slidesToShow: 1,
    slidesToScroll: 1
    }
    }
    // You can unslick at a given breakpoint now by adding:
    // settings: "unslick"
    // instead of a settings object
    ]
    });

    });

    }) (jQuery);
    </script>
    Quote Originally Posted by Feznizzle View Post
    Crud, I deleted my back up tpl_modules_additional_images.php from right before you gave me the new code!

    Anyway, I had my js inside of that file. Not sure how I had it cuz I can't seem to replicate it now.

    Below is the last way I tried it. Breaks the page. Can you show me how to work it back in?

  5. #25
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Working again, ty!

    It's stacking additional images when no scroll is triggered (less than 4 additional images).

    Gonna try to figure that out b4 bed...

    One more thing though! How do I kill that left scroll button?

  6. #26
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Pretty sure I need that "clear both" that I deleted previously, since we now have additional images standing alone if no scroll. Just can't figure out where.

  7. #27
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: JS/CSS thumbnail slider for additional images

    OK lets finish it up:

    2 changes, adds div with stock class if less than 3 images

    PHP Code:
    <?php
    /**
     * Module Template:
     * Loaded by product-type template to display additional product images.
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 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: tpl_modules_additional_images.php 3215 2006-03-20 06:05:55Z birdbrain $
     * 
     */

     
    require(DIR_WS_MODULES zen_get_module_directory('additional_images.php'));

     if (
    $flag_show_product_info_additional_images != && $num_images 0) {

     if (
    $num_images 3) {
     echo 
    '<div class="responsive">';
     } else {
     echo 
    '<div id="productAdditionalImages">';
     }

    if (
    is_array($list_box_contents) > ) {
     for(
    $row=0;$row<sizeof($list_box_contents);$row++) {
        
    $params "";
        
    //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];

        
    for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
          
    $r_params "";
          if (isset(
    $list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
         if (isset(
    $list_box_contents[$row][$col]['text'])) {

    echo 
    '<div class="centeredContent">' $list_box_contents[$row][$col]['text'] .  '</div>'


          }
        }
      }
    }


     echo 
    '</div>';
      }
    ?>  
    <script type="text/javascript">
    (function($) {
    $(document).ready(function() {

    $('.responsive').slick({
    dots: false,
    infinite: true,
    speed: 300,
    slidesToShow: 3,
    slidesToScroll: 3,
    responsive: [
    {
    breakpoint: 1024,
    settings: {
    slidesToShow: 3,
    slidesToScroll: 3,
    infinite: true,
    dots: true
    }
    },
    {
    breakpoint: 600,
    settings: {
    slidesToShow: 1,
    slidesToScroll: 1
    }
    },
    {
    breakpoint: 480,
    settings: {
    slidesToShow: 1,
    slidesToScroll: 1
    }
    }
    // You can unslick at a given breakpoint now by adding:
    // settings: "unslick"
    // instead of a settings object
    ]
    });

    });

    }) (jQuery);
    </script>
    in the jscript file for the slider find:
    PHP Code:
                    prevArrow'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button"><i class="fa fa-angle-double-left"></i></button>'
    change to:
    PHP Code:
                    prevArrow''
    or add
    Code:
    .slick-prev { display:none; }
    to bottom of slider css file


    Quote Originally Posted by Feznizzle View Post
    Working again, ty!

    It's stacking additional images when no scroll is triggered (less than 4 additional images).

    Gonna try to figure that out b4 bed...

    One more thing though! How do I kill that left scroll button?

  8. #28
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: JS/CSS thumbnail slider for additional images

    This is really an awesome responsive carousel for anyone that comes across this thread.

    product info page (basic responsive carousel)

  9. #29
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Awesomeness!!

    One last minor glitch. When no scroll is triggered, the additional images stack. Here is a link:
    http://0stage.justmedical***DOT***bi...roducts_id=159

    I'm pretty sure that goes back to this:
    https://www.zen-cart.com/showthread....60#post1307260

    Now that you have separated out the js, seems like the clear both needs to get put back into the group that does not receive js?

    I just can't figure where...

  10. #30
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Quote Originally Posted by rbarbour View Post
    This is really an awesome responsive carousel for anyone that comes across this thread.

    product info page (basic responsive carousel)
    I agree, digging it!

    But what is that screenshot?

    When I dl'ed the slick package, I saw a bunch of .exe type files, but I'm on a mac. Is there a software package for pc for generating the slider?

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Additional images jquery mini-slider --- is it possible?
    By Invizix in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 17 Sep 2012, 12:48 PM
  2. Main Image Thumbnail Appear With Additional Images
    By cv733 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 24 Jan 2011, 08:38 PM
  3. How do I show the main image as a thumbnail with the additional images?
    By rikahsdesign in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 24 Jan 2011, 03:45 AM
  4. CSS & additional images
    By Paris in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 30 Aug 2007, 11:42 PM
  5. Define thumbnail for large product images?
    By shirster in forum General Questions
    Replies: 4
    Last Post: 29 Apr 2007, 06:19 AM

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