Difference between revisions of "Nintendo DSi Browser"
Thewiirocks (talk | contribs) |
Thewiirocks (talk | contribs) |
||
Line 67: | Line 67: | ||
=== Vertical mode === | === Vertical mode === | ||
− | To active the vertical mode automatically, add | + | To active the vertical mode automatically, add one of the following tags between <head></head> : |
+ | <meta name="viewport" content="width=device-width"> | ||
<meta name="viewport" content="width=240"> | <meta name="viewport" content="width=240"> | ||
− | You can test | + | Using device-width will adapt the page to the width of other mobile devices. |
+ | |||
+ | You can test this mode with the following demo page: [http://www.cashman-productions.fr.nf/dsi/ here] | ||
+ | |||
+ | == Screen Resolution == | ||
+ | |||
+ | The DSi screen resolution is 256x192. However, the viewable area in the browser is only <b>240x176</b>. Both screens provide the same viewable area. | ||
+ | |||
+ | In vertical mode, you can have a page span both screens. However, the browser will behave as if the bottom screen is the only active screen and the top screen is scrolled off. This is important when computing CSS coordinates. Items positioned from "bottom" will be positioned based on 176px and not the full 352px of both screens. | ||
+ | |||
+ | == Using Both Screens == | ||
+ | |||
+ | Here's how your webpage can span both screens: | ||
+ | |||
+ | # Use the meta tag to set vertical mode | ||
+ | # Ensure that your page takes up exactly 240x352 pixels. | ||
+ | # Add the following JavaScript just before the </body> tag: | ||
+ | |||
+ | <script>document.body.scrollTop = 176;</script> | ||
+ | |||
+ | Generally the easiest way to accomplish the correct layout is to create HTML elements that "contain" the top and bottom screens. Here's an example: | ||
+ | |||
+ | <html> | ||
+ | <head> | ||
+ | <meta name="viewport" content="width=240"> | ||
+ | <style> | ||
+ | body { margin: 0px; } | ||
+ | #topscreen, #bottomscreen { width: 240px; height: 176px; } | ||
+ | </style> | ||
+ | </head> | ||
+ | <body> | ||
+ | <div id="topscreen">Top Screen</div> | ||
+ | <div id="bottomscreen">Bottom Screen</div> | ||
+ | </body> | ||
+ | </html> | ||
+ | |||
+ | This scheme allows the page to be easily manipulated through JavaScript. | ||
=== Detect User Agent === | === Detect User Agent === | ||
Line 108: | Line 145: | ||
* Left and Right can be read only if L or R are held | * Left and Right can be read only if L or R are held | ||
* Holding L or R disables the A button | * Holding L or R disables the A button | ||
+ | |||
+ | == Example Sites == | ||
+ | <!-- If you have a website that demonstrates these techniques, place it here! --> | ||
+ | * [http://www.cashman-productions.fr.nf/dsi/ Vertical test page] | ||
+ | * [http://www.dsicade.com DSiCade] | ||
== See also == | == See also == |
Revision as of 16:22, 21 April 2009
Browse the web with the second edition of the Opera browser for DSi. The browser use Opera 9.50. This application is available on the Nintendo DSi Shop. It's free.
Features/Limitations
Feature | Supported |
---|---|
Audio | No |
Canvas | Limited |
CSS2 | Yes |
CSS3 | Partial (test here) |
DOM | Yes |
DOM2 | Yes |
Javascript | Yes |
File Download | No |
File Upload | No |
Flash | No |
HTML5 | Partial |
Plugins | No |
SVG | No |
Video | No |
XHTML | Yes |
XMLHttpRequest | Yes |
User Agent strings
Sample DSi Browser User Agent Strings :
- Opera/9.50 (Nintendo DSi; Opera/483; U; en-US)
- Opera/9.50 (Nintendo DSi; Opera/483; U; en-GB)
Tips
Vertical mode
To active the vertical mode automatically, add one of the following tags between <head></head> :
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=240">
Using device-width will adapt the page to the width of other mobile devices.
You can test this mode with the following demo page: here
Screen Resolution
The DSi screen resolution is 256x192. However, the viewable area in the browser is only 240x176. Both screens provide the same viewable area.
In vertical mode, you can have a page span both screens. However, the browser will behave as if the bottom screen is the only active screen and the top screen is scrolled off. This is important when computing CSS coordinates. Items positioned from "bottom" will be positioned based on 176px and not the full 352px of both screens.
Using Both Screens
Here's how your webpage can span both screens:
- Use the meta tag to set vertical mode
- Ensure that your page takes up exactly 240x352 pixels.
- Add the following JavaScript just before the </body> tag:
<script>document.body.scrollTop = 176;</script>
Generally the easiest way to accomplish the correct layout is to create HTML elements that "contain" the top and bottom screens. Here's an example:
<html> <head> <meta name="viewport" content="width=240"> <style> body { margin: 0px; } #topscreen, #bottomscreen { width: 240px; height: 176px; } </style> </head> <body> <div id="topscreen">Top Screen</div> <div id="bottomscreen">Bottom Screen</div> </body> </html>
This scheme allows the page to be easily manipulated through JavaScript.
Detect User Agent
To detect if the user agent is Nintendo DSi Browser :
<script type="text/javascript"> window.onload=function() { if (navigator.userAgent.indexOf('Nintendo DSi') == -1) //If the UserAgent is not "Nintendo DSi" { location.replace('http://www.dsibrew.org'); //Redirect to an other page } } </script>
Key Codes
Code | Button |
---|---|
13 | A |
37 | Left |
38 | Up |
39 | Right |
40 | Down |
Notes :
- Only A, Up, and Down normally emit codes
- Left and Right can be read only if L or R are held
- Holding L or R disables the A button