Advertisement
Guest User

asdasd

a guest
Sep 2nd, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <dnn:DnnJsInclude ID="DnnJsInclude2" runat="server" FilePath="js/jquery.backstretch.min.js" PathNameAlias="SkinPath" AddTag="false" />
  2. <dnn:DnnJsInclude ID="DnnJsInclude3" runat="server" FilePath="http://maps.googleapis.com/maps/api/js?sensor=false" />
  3.  
  4. <dnn:DnnJsInclude ID="dttg" runat="server" FilePath="js/doubletaptogo.min.js" PathNameAlias="SkinPath" AddTag="false"/>
  5. <script type="text/javascript">
  6. $(function () {
  7. $('#navdttg li:has(ul)').doubleTapToGo();
  8. });
  9.  
  10. $(function () {
  11. var lati,longi;
  12. if (typeof google === 'object' && typeof google.maps === 'object') {
  13. alert("goggle maps Iniciado correctamente");
  14. }
  15.  
  16. var options = {
  17. enableHighAccuracy: true,
  18. timeout: 5000,
  19. maximumAge: 0
  20. };
  21. navigator.geolocation.getCurrentPosition(
  22. function (position) {
  23. lati = (position.coords.latitude);
  24. longi = (position.coords.longitude);
  25. var geocoder = new google.maps.Geocoder();
  26. var latlng = new google.maps.LatLng(lati, longi);
  27. geocoder.geocode({'latLng': latlng}, function(results, status) {
  28.  
  29. if (status == google.maps.GeocoderStatus.OK) {
  30. if (results[0]) {
  31. alert(results[0].formatted_address);
  32. getCityName(results[4].formatted_address);
  33. }
  34. } else {
  35. alert("Geocoder failed due to: " + status);
  36. }
  37. });
  38. },
  39.  
  40. function () {
  41. handleNoGeolocation(true);
  42. },options);
  43.  
  44.  
  45.  
  46.  
  47.  
  48. });
  49.  
  50. function getCityName(result) {
  51. var info = result.split(",");
  52. setBackground(info[0]);
  53. //return info[0];
  54. }
  55.  
  56. function setBackground(ciudad) {
  57.  
  58. alert(ciudad);
  59. var ciudad = ciudad+"/";
  60.  
  61. $.backstretch([
  62. "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "1.jpg"
  63. , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "2.jpg"
  64. , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "3.jpg"
  65. , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "4.jpg"
  66. , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "5.jpg"
  67. , "<%=SkinPath%>/Images-Carousel/bg/" + ciudad + "6.jpg"
  68. ], { duration: 6000, fade: 750 });
  69.  
  70. }
  71.  
  72. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement