Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <dnn:DnnJsInclude ID="DnnJsInclude2" runat="server" FilePath="js/jquery.backstretch.min.js" PathNameAlias="SkinPath" AddTag="false" />
- <dnn:DnnJsInclude ID="DnnJsInclude3" runat="server" FilePath="http://maps.googleapis.com/maps/api/js?sensor=false" />
- <dnn:DnnJsInclude ID="dttg" runat="server" FilePath="js/doubletaptogo.min.js" PathNameAlias="SkinPath" AddTag="false"/>
- <script type="text/javascript">
- $(function () {
- $('#navdttg li:has(ul)').doubleTapToGo();
- });
- $(function () {
- var lati,longi;
- if (typeof google === 'object' && typeof google.maps === 'object') {
- alert("goggle maps Iniciado correctamente");
- }
- var options = {
- enableHighAccuracy: true,
- timeout: 5000,
- maximumAge: 0
- };
- navigator.geolocation.getCurrentPosition(
- function (position) {
- lati = (position.coords.latitude);
- longi = (position.coords.longitude);
- var geocoder = new google.maps.Geocoder();
- var latlng = new google.maps.LatLng(lati, longi);
- geocoder.geocode({'latLng': latlng}, function(results, status) {
- if (status == google.maps.GeocoderStatus.OK) {
- if (results[0]) {
- alert(results[0].formatted_address);
- getCityName(results[4].formatted_address);
- }
- } else {
- alert("Geocoder failed due to: " + status);
- }
- });
- },
- function () {
- handleNoGeolocation(true);
- },options);
- });
- function getCityName(result) {
- var info = result.split(",");
- setBackground(info[0]);
- //return info[0];
- }
- function setBackground(ciudad) {
- alert(ciudad);
- var ciudad = ciudad+"/";
- $.backstretch([
- "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "1.jpg"
- , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "2.jpg"
- , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "3.jpg"
- , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "4.jpg"
- , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "5.jpg"
- , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "6.jpg"
- ], { duration: 6000, fade: 750 });
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement