views:

63

answers:

1

Hi there,

I am trying to implement jquery.serialScroll as gallery with fixed width and random width pictures (here). Everything works fine but I cant properly set the offset setting, so when you scroll to last picture there is a lot of grey space on the right. When I had tried to set offset (about 700), gallery froze down :(

Do you know about some simple solution how to align the last picture with right end ?

Thank you in advance for your answers.

JS:

jQuery.easing.easeOutQuart = function (x, t, b, c, d) {     
   return -c * ((t=t/d-1)*t*t*t - 1) + b; 
};

$(document).ready(function(){    
    $('#slideshow').serialScroll({      
        items:'li',         
        prev:'#slideshow_prev',         
        next:'#slideshow_next',         
        //offset:-700,          
        start:0,        duration:1200,      
        axis: 'x',      force:true,         
        stop:true,      lock:false,         
        //exclude:4,   -> cant use because of random width pictures 
        cycle:false,
        easing:'easeOutQuart',      
        jump: false     
    });

    $('#slideshow a.slideshow_gallery').fancybox({      
      hideOnContentClick: false,        
      zoomSpeedIn:  400,        
      zoomSpeedOut: 400,        
      'type': 'image' 
    });    
});

(For html and css follow the link)

A: 

Solved,

I simply iterate trough images, count its width and then set the css width of wrapper element.

Jaroslav Machotka