Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS that produces list of nearest bus stops and adds links to the page
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |