Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3965962
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:32:09+00:00 2026-05-20T03:32:09+00:00

I recently bumped into an article from inchoo It changes the default way on

  • 0

I recently bumped into an article from inchoo

It changes the default way on how magento displays more view thumbnails.. It’s easy to integrate but I want a more extended functionality which is when the Main picture (the large image) is clicked, it will display the image currently in the main picture in a lightbox. Here’s the code of my media.phtml…

I have integrated a thickbox in my magento just by using class=”thickbox” in an tag..

<?php
    $_product = $this->getProduct();
    $_helper = $this->helper('catalog/output');
    $_gallery = $this->getGalleryImages();

    $_resize = 350;
?>

<style type="text/css">
    .product-img-box .more-views li.slide-current a{ border:2px solid #aaa; }
    .product-img-box .product-image-zoom img { cursor: pointer; }
    #slide-loader{ visibility:hidden; position:absolute; top:auto; left:auto; right:2px; bottom:2px; width: 25px; height: 25px; }
</style>

<script type="text/javascript">
function slide(url,num,gallery){
    if (typeof slide.loading == 'undefined') slide.loading = false;
    if(slide.loading) return false;

    var loader = new Image();
    $(loader).observe('load', function(){

        $('slide-loader').setStyle({'visibility':'hidden'});

        $$('div.more-views li').each(function(el,i){
            (i==num) ? el.addClassName('slide-current') : el.removeClassName('slide-current');
        });

        var dummy = new Element('img', { src: url }).setOpacity(0);
        new Insertion.After('image', dummy);
        new Effect.Opacity(dummy, { duration:.5, from:0, to:1.0 });
        new Effect.Opacity($('image'), { duration:.5, from:1.0, to:0, 
             afterFinish: function(){
                $('image').writeAttribute('src',url).setOpacity(1).observe('click',function(e){
                    Event.stop(e);
                    popWin(gallery, 'gallery', 'width=300,height=300,left=50,top=50,location=no,status=yes,scrollbars=yes,resizable=yes'); 
                    return false;

                 })
                dummy.remove();
                slide.loading = false;
             }
        });
    });

    $('slide-loader').setStyle({'visibility':'visible'});
    loader.src=url;

    slide.loading = true;
return false;
}
</script>


<p class="product-image-zoom">
    <?php
        $_img = '<a class="thickbox" href="'.$this->helper('catalog/image')->init($_product, 'image').'" title="'.$this->htmlEscape($this->getImageLabel()).'"><img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" /></a>';
        echo $_helper->productAttribute($_product, $_img, 'image')
    ?>
    <img id="slide-loader" src="<?php echo $this->getSkinUrl('images/lightbox/loading.gif') ?>" />
</p>
<!-- <p class="a-center" id="track_hint"><?php echo $this->__('Click on above image to view full picture') ?></p> -->

<?php if (count($_gallery) > 0): ?>
<div class="more-views">
    <h4><?php echo $this->__('More Views') ?></h4>
    <ul>
    <?php foreach ($_gallery as $_image): ?>
        <li>
            <a href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()); ?>" onclick="slide('<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()) ?>',<?php echo ($s = isset($s) ? ++$s : 0) ?>,'<?php echo $this->getGalleryUrl($_image) ?>'); return false;"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(65); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
        </li>
    <?php endforeach; ?>
    </ul>
</div>
<?php endif; ?>

Thanks and more power!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:32:10+00:00Added an answer on May 20, 2026 at 3:32 am

    Why not just use one of the many lightbox modules already available in connect?

    http://www.magentocommerce.com/magento-connect/TemplatesMaster/extension/1487/magento-easy-lightbox/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've recently bumped into something called IOCP on the windows platform, to be more
I've recently bumped into facelift, an alternative to sIFR and I was wondering if
Recently I bumped into a problem where my OpenGL program would not render textures
Recently I've bumped into a realization/implementation of the Singleton design pattern for C++. It
I have recently started programming in WPF and bumped into the following problem. I
Recently, I read an article entitled SATA vs. SCSI reliability . It mostly discusses
Recently, I read this article: http://download.oracle.com/javase/tutorial/extra/generics/wildcards.html My question is, instead of creating a method
Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion
Recently I have been investigating the possibilities of caching in ASP.NET. I rolled my
Recently, I started changing some of our applications to support MS SQL Server as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.