Skip to content

Commit

Permalink
JS that produces list of nearest bus stops and adds links to the page
Browse files Browse the repository at this point in the history
  • Loading branch information
ciudilo committed Sep 26, 2011
1 parent e026cff commit f855dd4
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions locate.html
@@ -0,0 +1,40 @@
<html>
<head>
<title>Countdown Mobile</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
var loc;
navigator.geolocation.getCurrentPosition(function(position) {
$.getJSON('shortly/'+ position.coords.latitude + '/' + position.coords.longitude + '/' + '10', function(data){
$.each(data ,function(i, element){
$('body')
.append('<a href=/#' + element.id + '>' + element.name + '</a><br />');
});
});
});
</script>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
</head>
<style type="text/css">
@media screen and (max-device-width: 480px){
body{
-webkit-text-size-adjust:100%;
font-family:Helvetica, Arial, Verdana, sans-serif;
padding:2px;
}
div{
clear:both!important;
display:block!important;
width:100%!important;
float:none!important;
margin:2!important;
padding:0!important;
text-align:center;
}
}
</style>

<body>

</body>
</html>

0 comments on commit f855dd4

Please sign in to comment.