<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Retour à La Source • Tag: iPhone • RSS</title>
		<link>http://www.ab-d.fr/tag/iPhone/</link>
		<description>Retour à La Source • Tag: iPhone • RSS</description>
		<copyright>http://www.ab-d.fr/tag/iPhone/ (c) 2010</copyright>
		<language>fr</language>
		<pubDate>Sat, 31 Jul 2010 15:05:38 +0100</pubDate>
		<generator>Retour à La Source • Tag: iPhone • RSS • version 1.0</generator>
		<webMaster>noreply@ab-d.fr ( Benoit Asselin )</webMaster>
		<image>
			<url>http://www.ab-d.fr/images/rss.gif</url>
			<title>Retour à La Source • Tag: iPhone • RSS</title>
			<link>http://www.ab-d.fr/tag/iPhone/</link>
			<width>90</width>
			<height>30</height>
		</image>

		<item>
			<title>Gérer window.orientation avec un iPhone / iPod Touch dans Safari (Webkit)</title>
			<link>http://www.ab-d.fr/date/2008-03-08/</link>
			<pubDate>Sat, 08 Mar 2008 18:31:13 +0100</pubDate>
			<author>noreply@ab-d.fr ( Benoit Asselin )</author>
			<category><![CDATA[iPhone]]></category>
			<category><![CDATA[Javascript]]></category>
			<category><![CDATA[Webkit]]></category>
			<description><![CDATA[<p>
Ce script vous permet de déterminer et de gérer l'orientation d'un iPhone ou d'un iPod Touch grâce à la variable <code>window.orientation</code> et à l'évènement <code>window.onorientationchange</code>.
</p>
<p>Exemple <strong>page-iphone-orientation.html</strong></p>
<pre>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"&gt;
&lt;head&gt;
	&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
	&lt;title&gt; window.onorientationchange &amp; window.orientation &lt;/title&gt;
	
	&lt;script type="text/javascript"&gt;
	
	window.onorientationchange = function() {
		if(window.orientation !== undefined) {
			document.getElementById('value-1').innerHTML = window.orientation;
			switch(window.orientation) {
				case 0 :
					document.getElementById('value-2').innerHTML = 'Portrait - Normal';
					break;
				case 90 :
					document.getElementById('value-2').innerHTML = 'Paysage - Dans le sens &lt;strong&gt;contraire&lt;\/strong&gt; des aiguilles d\'une montre.';
					break;
				case -90 :
					document.getElementById('value-2').innerHTML = 'Paysage - Dans le sens des aiguilles d\'une montre.';
					break;
				case 180 :
					document.getElementById('value-2').innerHTML = 'Portrait - Renvers&eacute;';
					break;
			}
		} else {
			/* Vous n'utilisez ni un iPhone, ni un iPod Touch... */
			alert('Votre navigateur web ne supporte pas window.orientation');
		}
	}
	window.onload = window.onorientationchange;
	
	&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
	
	&lt;h1&gt;window.onorientationchange &amp; window.orientation&lt;/h1&gt;
	
	&lt;p&gt;window.orientation = &lt;span id="value-1"&gt;&lt;/span&gt; // &lt;span id="value-2"&gt;&lt;/span&gt;&lt;/p&gt;
	
	&lt;p&gt;Cette page ne fonction qu'avec les iPhone et les iPod Touch.&lt;/p&gt;
	
&lt;/body&gt;
&lt;/html&gt;

</pre>

<p>Ce script pourrait aussi servir à détecter si le navigateur utilisé est bien un navigateur Safari iPhone / iPod Touch.</p>

<hr /><a href="http://res.feedsportal.com/viral/bookmark_fr.cfm?link=http%3A%2F%2Fwww.ab-d.fr%2Fdate%2F2008-03-08%2F&title=G%C3%A9rer+window.orientation+avec+un+iPhone+%2F+iPod+Touch+dans+Safari+%28Webkit%29"><img src="http://www.ab-d.fr/images/bookmark.gif" border="0" /></a><br /><br />]]></description>
			<comments>http://www.ab-d.fr/tag/iPhone/</comments>
			<guid isPermaLink="false">http://www.ab-d.fr/date/2008-03-08/</guid>
		</item>

		<item>
			<title>Comment détecter le navigateur iPhone ? (Safari, Webkit)</title>
			<link>http://www.ab-d.fr/date/2007-11-29/</link>
			<pubDate>Thu, 29 Nov 2007 00:00:00 +0100</pubDate>
			<author>noreply@ab-d.fr ( Benoit Asselin )</author>
			<category><![CDATA[iPhone]]></category>
			<category><![CDATA[Safari]]></category>
			<category><![CDATA[Webkit]]></category>
			<description><![CDATA[<p>Voici le navigateur Safari d'un iPhone Français</p>
<pre>
Mozilla/5.0 (<strong>iPhone</strong>; U; CPU like Mac OS X; fr) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3

</pre>

<hr /><a href="http://res.feedsportal.com/viral/bookmark_fr.cfm?link=http%3A%2F%2Fwww.ab-d.fr%2Fdate%2F2007-11-29%2F&title=Comment+d%C3%A9tecter+le+navigateur+iPhone+%3F+%28Safari%2C+Webkit%29"><img src="http://www.ab-d.fr/images/bookmark.gif" border="0" /></a><br /><br />]]></description>
			<comments>http://www.ab-d.fr/tag/iPhone/</comments>
			<guid isPermaLink="false">http://www.ab-d.fr/date/2007-11-29/</guid>
		</item>

	</channel>
</rss>
