kswedberg/jquery-smooth-scroll

Scroll to Center

coolbreezeneu opened this issue · 4 comments

Apologies for my noob question but...

I'm using your lovely plugin to scroll horizontally and would like to alter it to position the scrolled element in the center of the window in instances where the window is greater than 600px wide. Is there a way to make the offset option accept a percentage or a variable?

Hey @coolbreezeneu, this is probably too late to be of use to you, but (if I'm understanding your request correctly) the easiest way to do it would be using CSS to make a hidden-floating-non-wrapping element, and set it's location as a percentage offset.

@kswedberg going by the lack of a response for more than two weeks, I'm guessing the original poster's question is no longer a problem/relevant. Close Issue?

@travco: yep, thanks. closing.

Thanks for closing this out. I haven't had a chance to implement the suggestion from @travco yet but it seems like a reasonable fix and I can always reach back out if I run into trouble. Thanks for the help.