Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Support for responsive pages #33

Closed
wants to merge 1 commit into from
Closed

Support for responsive pages #33

wants to merge 1 commit into from

Conversation

nneal
Copy link

@nneal nneal commented Dec 12, 2012

This will add support for responsive pages that float columns vertically at certain breakpoints.

By the way, nice plugin! Been really happy with it so far.

@garand
Copy link
Owner

garand commented Jan 8, 2013

Thanks for this! I'll take a look at it and merge it in soon.

@ghost ghost assigned garand Jul 20, 2013
paumoreno added a commit to paumoreno/sticky that referenced this pull request Apr 25, 2014
Builds on top of garand#33. 

The property `minWidthToStick` (called `responsiveBreakpoint` in garand#33) can be set for each element to override the default value.
@garand garand removed their assignment May 2, 2014

for (var i = 0; i < sticked.length; i++) {
var s = sticked[i],
elementTop = s.stickyWrapper.offset().top,
etse = elementTop - s.topSpacing - extra;

if (scrollTop <= etse) {
if (scrollTop <= etse || $window.width() < o.responsiveBreakpoint) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

o.responsiveBreakpoint is relying on the defaults object being overwritten whenever this plugin is called: see #104.

If you set responsiveBreakpoint on the sticky object that gets added in methods.init – see code here – you can access it here via s.responsiveBreakpoint and it will reflect that sticky object rather than an accidentally changed global state.

Line 39 can be removed if this is done: o = $.extend(defaults);

@nneal nneal closed this Jan 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants