Magento Forum

   
[solved] Product.js - SliderValue / Re-Initialize
 
Toff
Jr. Member
 
Total Posts:  20
Joined:  2008-02-18
 

Hello

I have develop a “prev” and “next” function for product image box on detailpage. Now i can “Zoom with Slider”, “Doubleclick” and “Change Image”.

Sample:
1. zoom in the first image
2. click next image (and reset SliderValue)

How can i reset the sliderValue in js/varian/product.js or Re-Initialize the complete Control.Slider?

Best Regards
Tobi

 
Magento Community Magento Community
Magento Community
Magento Community
 
Toff
Jr. Member
 
Total Posts:  20
Joined:  2008-02-18
 

My fast solution with Prototype.

// Interate Array and Show next Image
    $$('a.nextimage').invoke('observe''click', function(event){

        
var image = $$('.product-image-zoom img');
        var 
handle = $$('#handle');

        if (
== base_images.size()) { n=0}

            image
.invoke('writeAttribute''src'base_images[n]);
            
n++;

        
// reset zoom
        
if (image.invoke('getStyle','left') != 0)
        
{
            image
.invoke('setStyle','left:0');
            
image.invoke('setStyle','top:0');
            
image.invoke('setStyle','width:265px');
            
handle.invoke('setStyle','left:0');
        
}

    }
);

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top