Shammus
02-06-2012, 08:46 PM
Was trying to implement a script that would read whether or not you're using IOS 5 for the iPad and adjust the CSS accordingly. The script below assumes that the app is being built in 4.3 and adds an adjustment to the <footer> CSS class if the page is being viewed in IOS 5.
Problem is, it's not working. Any thoughts on what I might be doing wrong?
Thanks in advance....
-----------------------------------------
<!DOCTYPE html>
<html lang="en">
<head>
<style type="text/css">
body {}
article {position:relative; height:500px; background:red;}
footer {position:absolute; bottom:100px;}
h3 {position:absolute; top:100px;}
</style>
<script type="text/javascript" charset="utf-8">
var iOS5 = navigator.userAgent.match(/OS 5_/i) != null;
if (iOS5) {
$("footer").css('bottom','0');
$("body").append('<h3>This is for iOS5</h3>');
}
</script>
</head>
<body>
<article>
<footer>This is the footer.</footer>
</article>
</body>
</html>
Problem is, it's not working. Any thoughts on what I might be doing wrong?
Thanks in advance....
-----------------------------------------
<!DOCTYPE html>
<html lang="en">
<head>
<style type="text/css">
body {}
article {position:relative; height:500px; background:red;}
footer {position:absolute; bottom:100px;}
h3 {position:absolute; top:100px;}
</style>
<script type="text/javascript" charset="utf-8">
var iOS5 = navigator.userAgent.match(/OS 5_/i) != null;
if (iOS5) {
$("footer").css('bottom','0');
$("body").append('<h3>This is for iOS5</h3>');
}
</script>
</head>
<body>
<article>
<footer>This is the footer.</footer>
</article>
</body>
</html>