eddiemf / vue-affix

A Vue.js plugin that affixes an element on the window while scrolling based on a relative element
MIT License
405 stars 38 forks source link

Using vue-affix with responsive divs #35

Open ahmedfaical opened 5 years ago

ahmedfaical commented 5 years ago

Hello, I would like to use your plugin. I'm using nuxt and vuetify with grid system, so all divs are displayed with percentage. This is an example for md4 class

Screenshot 2019-03-12 at 13 36 02

My issue here is that i can't set a specific width for .vue-affix class, otherwise my templates aren't responsive anymore! Any idea how to do this with a props or something else ? Maybe your plugin can calculate the with bases on its percentage width then insert it with inline CSS?

I can resolve this by calculating width of divs but it's not a clean solution.

Thanks a lot for your help

eddiemf commented 5 years ago

I don't really understand what exactly you want to be able to do. Do you need to pass a class or style directly to the .vue-affix element?

Would a prop allowing you to pass properties to it help?

I haven't been using Vue for a long time, so I'm not really sure what would be the best solution here, I'm just trying to still maintain these libs since there's a lot of people using them still :)

projct1 commented 5 years ago

@eddiemf Why we have to set width? Why plugin cant calculate width dynamically based on parent width? https://leafo.net/sticky-kit/ Here do this.