I’m trying to create a carousel similar to http://www.aprica.jp/, using jQuery and HTML. To do so, I need to be able to horizontally center the contents of a large (overflow-hidden) div to the viewport. Any ideas how I can do that?
I’m trying to create a carousel similar to http://www.aprica.jp/ , using jQuery and HTML.
Share
Ok Buzz, if i understand you need a way to center a div inside another ‘overflow: hidden’ div.
I imagine you don’t know in advance the width of the inner div. You sead you want to use JQuery than ou have to calculate the left margin of the inner div with something like this:
This is a very simple case, if you need more, please ask.
PS: you need JQuery and JQuery.UI.