bbarakaci / fixto

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

Touch devices? #7

Closed EtKit closed 10 years ago

EtKit commented 11 years ago

Thank you for making this available. It looks good. One question - why do you mention "Touch devices not supported"? Given the nature of the plugin it strikes me that it is purely a layout controller and touch issues do not enter into the picture at all.

bbarakaci commented 11 years ago

Hi. Thanks. By the time i wrote this, ios was not supporting position fixed so i decided to leave out mobile devices. I called them touch devices because the plugin checks if the device has touch events enabled and if so, disables itself. I mentioned in the readme section because lots of people (including me) would expect to have the functionality on an ipad for example. I decided to let people know beforehand.

As now position fixed is being supported by ios, i am thinking to give a shot on enabling it for the touch devices. Thanks again.

elclanrs commented 11 years ago

I've been using your plugin for some time and it works great but it would be ideal if you could activate it for at least Android 3/4 and iOS5, they both support fixed scrolling. Keep up the good work!

christian-froh commented 10 years ago

Whats the status on that point? Can I somehow enable it for touch devices? By the way: Very good job. Its a nice plugin

bbarakaci commented 10 years ago

I gave it a shot but it turned out to be complicated.

I enabled it for touch devices and checked the result with ios. It was not only about fixed positioning but scrolling is handled differently on ios (onscroll event fires once when the scrolling finishes) thus effect is very creepy. I played a bit with touch events but couldn't reach a decent result in the short period of time i spent.

Remove touch from this line to enable: if(touch || ieversion<8){

You can also try native position sticky. I heard that it is supported on ios7 but never had the chance to confirm or play with.

Thanks.

bbarakaci commented 10 years ago

Enabled for touch devices. It will use position sticky when available, position fixed when available.