rdallasgray / roto

A simple, flexible, touch-capable scrolling plugin for jQuery.
http://rdallasgray.github.com/roto/
BSD 2-Clause "Simplified" License
72 stars 10 forks source link

De-activate roto, to default styles (save styles on init and reset them on reset) #10

Open jonascarlbaum opened 13 years ago

jonascarlbaum commented 13 years ago

Hi, I like roto, it seems coming in handy on a current project of mine — however the project I'm working on is using a responsive web approach, and I would like to be able to activate/deactivate roto when I check window resize events and checking the current window width etc. — so that tablet and smartphone sizes can use roto, but turn it off on desktop sizes.

It would be a nice feature I think, since the whole idea with roto must be the mobile web, and a big part of the approaches today is responsive web, so that effects a desktop window of different sizes too.

rdallasgray commented 13 years ago

Hi Jonas -- not sure I understand the issue. Can you not simply check resolutions etc., and then call or not call roto() based on the results?

Apologies if I'm being dense!

jonascarlbaum commented 13 years ago

Hi, thanks for answering.

Checking resolutions etc. and calling or not calling roto() is what I do — and it's no problems on most devices, where you either use or not use roto().

I meant that on a desktop you can resize your window and on iPad:s etc. you can get desktop-resolutions when flipped horizontally, and I would like to call roto() when the document width it's equal or less than 991px for example, as I do, but also when having a small window and I have already called roto() I would like the possibility to undo the functionality and the repositioned items to be at its original positions (I use it for the sites horizontal top menu), Therefore the style reset idea — so it can be used it in a true responsive way.

Update: I tried to remove changed styles when window width is greater than 991px — aka when I don't wish to use roto, but roto seems to fill UL with WIDTH, and LI:s with "display: block; float: left" — so, a pause function would suit me also, since I can reset all dynamic changes myself, I just wish that roto won't work when I don't need it, whatever solution is the simplest for you, works for me...

Apologies if my descriptions is hard to understand — hope this makes some sense!?