[Rails] Re: Rails, Javascript, and CSS
On Jan 3, 5:56 pm, Michael Satterwhite <li...@ruby-forum.com> wrote:
> I've searched the histories and don't see a relevant discussion. I'm
> sure it's there, but I haven't found it.
>
> I want to adjust the stylesheet loaded according to the user's screen
> resolution. I know there are browsers that don't report it (or not
> accurately), but that's what defaults are for. With the hard core gurus
> here, I'm sure some of you are doing that right now. I know (believe?)
> that this is going to require javascript. I've never had to marry
> javascript and rails code, so I'm not sure of the best way to approach
> this. Obviously, I want it to execute as the page is loading. Do I put
> this in the head section where it would normally be? Any and all hints
> you can give me will be greatly appreciated.
You don't have to use javascript - you can use media queries (http://
www.w3.org/TR/css3-mediaqueries/#device-width) to do things like have
a stylesheet that applies only to screens of a certain size or bigger.
I'm not sure how those interact with the varying screen densities
around (eg even though an iphone 4's screen is twice as wide and twice
as high as previous models, you'd probably want similar layout).
>
> As always, thanks in advance
> ---Michael
>
> --
> Posted viahttp://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