Thursday, May 12, 2011

[Rails] Re: How can I detect if the app is accessed from mobile?

Greg Willits wrote in post #692457:
> On Jun 22, 2008, at 1:56 AM, comopasta Gr wrote:
>
>> I want to make the divs of my views to take 100% width for mobile
>> browsers and something else for "pc".
>>
>> How can I detect that? Any hints?
>
> Use JavaScript to detect browser type.
>
> Google
> detect browser agent
> detect mobile browser agent
>
> -- gw

CSS would be much, much simpler for this:

div {
width: 80%;
}

@media handheld {
div {
width: 100%;
}
}

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate