darsain / sly

JavaScript library for one-directional scrolling with item based navigation support.
http://darsa.in/sly
2.87k stars 497 forks source link

startAT: confusion #234

Open ssavery opened 8 years ago

ssavery commented 8 years ago

Hey there,

I'm trying to get an image gallery to start on the 3rd image so that when the page loads, the gallery appears to be centered (like the image below) centered

However, I cannot seem to get the startAT: string to work... Check it out - www.brokenknucklefilmfest.com/page6.html

The page loads with the images off center. What am I missing here?

Please excuse my sloppy code...

Thanks for any help!

sergey-dev commented 8 years ago

@ssavery , what version of plugin are you using? I checked recently my implementation, and it works like a charm when using the startAt parameter during Initialization stage.

var slyOptions = {                                        
    horizontal: true,                                     
    itemNav: 'basic',                                     
    speed: 300,                                           
    mouseDragging: false,                                 
    touchDragging: true,                                  
    // controls to navigate                               
    nextPage: $navRight,                                  
    prevPage: $navLeft,                                   
    // navigate to active position, if applicable         
    startAt: activeElementPosition        // <===== here's it                
};                                                        
slyInstance = new Sly($frameSelector, slyOptions).init();