You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, this is a wonderful horizontal scroll gallery and it works beautifully!
I am trying to implement a function where if you click on an image it will bring it to the horizontal center of the scrolling gallery, however it is not working for some reason. I would like to know whether this is because of how the gallery has been coded that it will not allow for this kind of functionality? From what I have been seeing I think it might be the case.
Thanks!
The text was updated successfully, but these errors were encountered:
I had the same issue, the scrollToElement method works but doesn't align the slide horizontally center. I used the code I've included below to achieve this instead, hopefully it helps.
/**
* Horizontally center a slide
* Example usage: `scrollToSlide($('#Scroller'), $('#slide-1'));`
* @param {object} $scroller - element .smoothDivScroll() was used on
* @param {object} $slide - id of element to scroll to
*/
function scrollToSlide($scroller, $slide) {
var slideLeft = $slide.offset().left;
var slideCenter = $slide.outerWidth()/2;
var scrollerCenter = $scroller.outerWidth()/2;
$scroller.smoothDivScroll("move", (slideCenter+slideLeft)-scrollerCenter);
}
First of all, this is a wonderful horizontal scroll gallery and it works beautifully!
I am trying to implement a function where if you click on an image it will bring it to the horizontal center of the scrolling gallery, however it is not working for some reason. I would like to know whether this is because of how the gallery has been coded that it will not allow for this kind of functionality? From what I have been seeing I think it might be the case.
Thanks!
The text was updated successfully, but these errors were encountered: