bbarakaci / fixto

A jQuery plugin for sticky positioning
MIT License
217 stars 57 forks source link

Is there a way to disregard parent's bottom padding when calculating its offset? #23

Closed artemgordinskiy closed 9 years ago

artemgordinskiy commented 9 years ago

Hi, First of all, great job on the plugin, thank you!

I hope to find a way to have an element stay fixed until the absolute bottom of the parent, with no regard for its bottom padding. I encountered an issue with this line, specifically:

this._parentBottom = (this.parent.offsetHeight + this._fullOffset('offsetTop', this.parent)) - computedStyle.getFloat(this.parent, 'paddingBottom');

When I remove the last subtraction, it works perfectly for my use case. Maybe this could be added as an option? If so, I'd be happy to contribute.

bbarakaci commented 9 years ago

Hi, Thank you. Currently there is no way to ignore padding. Yes, why not, i think it is good to have it as an option.

artemgordinskiy commented 9 years ago

Okay, but how do I build it? I see a Grunt file but no package.json in there.

bbarakaci commented 9 years ago

I used to increase the version in the gruntfile and run grunt make

It will be also ok if you just commit the feature and optionally document the option on readme. I could take care of building and releasing the new version.

artemgordinskiy commented 9 years ago

I hope I didn't screw anything up. Also, tried to run grunt make, but got "Fatal error: Unable to find Gruntfile.", so I wasn't able to build the project, sorry.

bbarakaci commented 9 years ago

Excuse me for the delay, i couldn't find the time.

Maybe it is because the grunt version is quite old.

Thank you. Cheers.

artemgordinskiy commented 9 years ago

No problem, it's open source after all, nobody owes anything to anyone :smile: Thanks for accepting the PR!