How to hide a region for the mobile first layout?

Events happening in the community are now at Drupal community events on www.drupal.org.
zoon_unit's picture

I have a rotating banner on my Omega 3 site, but I don't want it to display when viewed on a mobile phone. (the default mobile first layout) How does one go about "turning off" regions for a particular width layout? (in this case, the default mobile first layout) but display the region in all other layouts? (narrow, normal, wide, etc)

Comments

It's more a question of

mrpauldriver's picture

It's more a question of hiding rather than turning off

See http://drupal.org/node/1343798

@MrPaulDriver

See the discussion at

I was afraid that was the answer :-)

zoon_unit's picture

To me, the biggest problem with display:none is that the content is still downloaded to the mobile device(?), so you gain no speed advantage on a smartphone. What we need is a way to "not request" the content, much like the adaptive image modules that serve up resolution appropriate images based on screen width.

This seems to be the last piece of the Omega puzzle. If we can somehow limit "data heavy" content to phones, then Omega will indeed be the perfect theme for all time. :-)

visibility: hidden

aristeides's picture

I think that with "display: none" the content still loads BUT if you set it to "visibility: hidden" it doesn't.

I read in the commentary for

mrpauldriver's picture

I read in the commentary for Flexslider (I can't remember where) that ultimately they'd like to end up with true responsive images, but that they are not there yet.

For now just show your slideshow, but keep the number of slides to a working minimum and use best practice in terms of image compression because that is all you can do. You'll find that the download times can be lived with, especially over 3g.

@MrPaulDriver

I achieved that functionality

jmolivas's picture

I achieved that functionality Responsive Sliders in Omega combining: Flexslider, Display Suite & Client-side adaptive image

-Views
Format:Slideshow | Settings Format: Slideshow Type
Show:Display suite | Teaser

-Display Suite - Teaser
Image Field - Format settings: Adaptive image and setting the "CLIENT WIDTH BREAKPOINT" 320, 480 , 768, etc...

--
http://jmolivas.com/
@jmolivas

Your method sounds very

mrpauldriver's picture

Your method sounds very interesting. Any chance of a write-up?

@MrPaulDriver

Sure I will do an entry on my

jmolivas's picture

Sure I will do an entry on my blog and attach some screenshot and descrption on each steps to achieve this.

You can see the flexslider example here, I just removed the css for hide on small device port size and now it's showing slider no matter the device size, that means you can decrease window size and verify image element using inspect element to see how image it's replaced based on breakpoint

NOTE: You still can see how the css on flexlider plugin takes care of adding responsive-fluid support to image.

--
http://jmolivas.com/
@jmolivas

Visibility: hidden still

jjma's picture

Visibility: hidden still loads the content (check the source of your document).

The difference between visibility:hidden and display:none is that visibility:hidden still effects the layout.i.e it's element still takes up the same space even though it is hidden.

Jon

hmmm... I thought it doesn't

aristeides's picture

hmmm... I thought it doesn't load the content and when I wanted to "hide" something I was using .class{visibility: hidden, display: none;}.
So what other options do we have? Would javascript do the trick?

Hi everyone, There's nothing

samwillc's picture

Hi everyone,

There's nothing wrong with mobile.css {display:none} and normal.css {display:block} for example. I do that on mine as I feel a slider on a mobile is so very pointless and there is no significant slowdown. I use 3 x slides with images 960px x 300px.

Works ok and I think it's a valid solution.

Sam.

Stuff that isn't for mobile

jorgbert's picture

Stuff that isn't for mobile shouldn't be getting sent to a low-bandwidth mobile device in the first place. That's not the role of media queries either. CSS controls layout, not what gets sent.

See how we do it at http://groups.drupal.org/node/208778#comment-690433

:)

Omega Framework

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: