Opened 11 years ago

Closed 11 years ago

#12725 closed enhancement (fixed)

Detect orientation and add CSS class to <html>

Reported by: ykami Owned by: ykami
Priority: high Milestone: 1.7
Component: DojoX Mobile Version: 1.6.0
Keywords: 1.7-mobile Cc:
Blocked By: Blocking:


To define orientation-specific (portrait/landscape) styles, it would be nice to have a CSS class that designates the current orientation on <html>.

Change History (2)

comment:1 Changed 11 years ago by ykami

(In [24508]) Refs #12725 !strict. Added orientation detection, screen size detection, and a sample code.

comment:2 Changed 11 years ago by ykami

Resolution: fixed
Status: newclosed

dj_portrait or dj_landscape will be added to <html> according to the orientation.

Also, screen size detection is added. If both width and height of the screen are larger than (=500), then dj_tablet is added to <html>. Otherwise, dj_phone is added. Either "/dojox/mobile/screenSize/tablet" or "/dojox/mobile/screenSize/phone" is sent by dojo.publish at the same time. A sample code that utilize those features is tests/test_screen-size-aware.html.

Note: See TracTickets for help on using tickets.