Try to search your question here, if you can't find : Ask Any Question Now ?

Center grid on a horizontal scroll window

HomeCategory: stackoverflowCenter grid on a horizontal scroll window
rupesh asked 1 week ago

I have a carousel grid in a fixed width element and I want the middle item to be centered. I am adding the left scroll position on load but that does not account for the browser window width. How can I calculate the window width and get the middle item to be always centered?

$('.grid-wrapper').ready(function() {
  $('.grid-wrapper').animate({
     scrollLeft: $('.checked').offset().left - 750
    }, 1000, function() {
  });
});

Here is my fiddle:
https://jsfiddle.net/khecker/Ld0wu2s9/8/

1 Answers
Best Answer
Arben answered 1 week ago
Your Answer

14 + 13 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com