Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Media Query in Browser

This is not really a Webworks question but relates to a non-packaged website targeting users of the Z10. 

 

I'm trying to make different background for Z10 then on Desktop with the following code.

 

@media (device-aspect-ratio: 15/9) {
    html{
        background: url(images/bg2.jpg) no-repeat center center fixed;
    }
}

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Media Query in Browser

fixed this problem was a small typo.

Must do 15:9 not 15/9


_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Media Query in Browser

nvm it is 15/9 not 15:9.

I thought it was working because the Z10 bg showed on Z10 but it's also showing on desktop now.
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Media Query in Browser

Are you still looking for support here, or have you resolved this?

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Media Query in Browser

I found a work around but I still want to know if my syntax is wrong or if device-aspect-ratio is not supported on BB Browser.

@media (device-aspect-ratio: 15/9) {
html{
background: url(images/bg2.jpg) no-repeat center center fixed;
}
}
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Media Query in Browser

Your syntax does appear to be correct:

http://www.w3.org/TR/css3-mediaqueries/#device-aspect-ratio

 

As an alternative, you could use the device-width and device-height properties (or width and height of viewport), I have used those before and they should be working. 

 

I'll write up a test case for the device-aspect-ratio and will submit a bug report if it is not working properly. I was under the assumption that we fully support the media queries standard, but I'll confirm and get back to you here.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.