Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

left position on resize #1

Open
pacmac opened this issue Mar 29, 2014 · 1 comment
Open

left position on resize #1

pacmac opened this issue Mar 29, 2014 · 1 comment

Comments

@pacmac
Copy link

pacmac commented Mar 29, 2014

Hi;
I am using your plugin with FOUNDATION and have just noticed that the left:position does not get adjusted when the page resizes.

This may be rare on a desktop but will be very common a mobile device.

<div class="stik autofix_sb bottom fixed" style="left: 600.5px; width: 800px;"> 
Can this be fixed to adjust itself on resize ?

I have hacked it to include the el.width as if the sticky element is not full width (i.e centered in the page) then it will extend itself to the extreme right of the page beyond the bounds of the original relative, unstuck element.

pos = el.offset();
wid = el.width();

el.addClass("bottom fixed").removeAttr( 'style' ).css({
left: curpos.left,
width: wid

You may want to consider adding something similar ?

@karljophillips
Copy link

I have come across the same problem, but couldn't get pacmac's fix to work.

I have got around the issue by resetting the fixed element. Then, just in case the user resizes while scrolled partway down the page, I also call manualfix.

$(window).resize(function(){
    $('#sidebar').removeClass("bottom fixed").removeAttr("style").autofix_anything();
    $('#sidebar').manualfix();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants