Return to Snippet

Revision: 8686
at October 2, 2008 21:00 by conspirator


Initial Code
<link rel="stylesheet" type="text/css" href="stylesheets/iphone_portrait.css" id="orient_css">

<script type="text/javascript" charset="utf-8">
	function orient()
	{
		switch(window.orientation){
			case 0: document.getElementbyId("orient_css").href = "stylesheets/iphone_portrait.css";
			break;
			
			case -90: document.getElementbyId("orient_css").href = "stylesheets/iphone_landscape.css";
			break;
			
			case 90: document.getElementbyId("orient_css").href = "stylesheets/iphone_landscape.css";
			break;
		}
	}
	window.onload = orient();
</script>

<body onorientationchange="orient();">

Initial URL


Initial Description


Initial Title
Load Specific Stylesheets for iPhone depending on Orientation

Initial Tags
css, javascript, textmate, iphone

Initial Language
Other