jquery - Is it possible to have a remote: true AJAX partial load into a bootstrap modal on desktop, but as a slide-in-from-the-side form on mobile devices? -


i have rails app working on desktop, ux on phone quite bad, bootstrap modals being loaded page. create new objects load form bootstrap modal using ajax , pop view on page.

as part of redesign make mobile user experience better considering using responds_to block design different layout mobile users, , dynamically loaded rails forms (it's data entry) render single page , slide in right, slide out once user submits action.

is possible? there suitable gem available might make easier?

i considering using responds_to block design different layout mobile users

don't.

you can use same layout, set css styling different.


responsive

you're best using media-queries.

lots of people confused / overwhelmed "responsive" interfaces; reality simple - use logic assign classes on per-platform basis, else should handled media queries. 99% of styling, logic & flow remains same.

in case, believe bootstrap's modals responsive (ie work on phones on desktop) - want assign different animations depending on viewport size.

--

classes

the logic need classes (how modal slides in).

we've used browser gem before - gives access user_agent data, including browser.mobile?, means you'll able use like:

#view <% styling = browser.mobile? "slide" : "show" %> <%= link_to "link", "#", class: styling %> 

i don't have huge experience bootstrap styling, i'd have read on how change modal animation. however, css3 animations transitions based on classes; change class, change animation.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -