Ir al contenido principal

Entradas

Mostrando entradas de junio, 2015

Custom event Javascript

// Crear el evento. var event = new CustomEvent ( 'nombre_evento' , {     'detail' : {         event : 'event' ,     } }); // y dispararlo al DOM document. dispatchEvent ( event ); // escuchar el evento en el DOM. document. addEventListener ( 'nombre_evento' , function ( e ) {     console . log ( e ); }, false );

Generar colores hexadecimales aleatoreamente con javascript

    function getRandomColor () {         var letters = '0123456789ABCDEF' . split ( '' );         var color = '#' ;         for ( var i = 0 ; i < 6 ; i ++ ) {             color += letters [Math. floor (Math. random () * 16 )];         }         return color ;     }

Iconos Estandar google maps api v3

Row 1 Dots https://maps.gstatic.com/mapfiles/ms2/micons/blue-dot.png https://maps.gstatic.com/mapfiles/ms2/micons/red-dot.png https://maps.gstatic.com/mapfiles/ms2/micons/green-dot.png https://maps.gstatic.com/mapfiles/ms2/micons/ltblue-dot.png https://maps.gstatic.com/mapfiles/ms2/micons/yellow-dot.png https://maps.gstatic.com/mapfiles/ms2/micons/purple-dot.png https://maps.gstatic.com/mapfiles/ms2/micons/pink-dot.png Dot Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/msmarker.shadow.png Row 2 Solid https://maps.gstatic.com/mapfiles/ms2/micons/blue.png https://maps.gstatic.com/mapfiles/ms2/micons/red.png https://maps.gstatic.com/mapfiles/ms2/micons/green.png https://maps.gstatic.com/mapfiles/ms2/micons/lightblue.png https://maps.gstatic.com/mapfiles/ms2/micons/yellow.png https://maps.gstatic.com/mapfiles/ms2/micons/purple.png https://maps.gstatic.com/mapfiles/ms2/micons/pink.png Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/msmarker.shadow.png

Waypoints in directions Google Maps JavaScript API

<!DOCTYPE html> <html>   <head>     <meta name= "viewport" content= "initial-scale=1.0, user-scalable=no" >     <meta charset= "utf-8" >     <title> Waypoints in directions </title>     <style>       html , body , #map-canvas {         height : 100 % ;         margin : 0px ;         padding : 0px       }       #panel {         position : absolute ;         top : 5px ;         left : 50 % ;         margin-left : -180px ;         z-index : 5 ;         background-color : #fff ;         padding : 5px ;         border : 1px solid #999 ;       }     </style>     <script src= "https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true" ></script>     <script> var directionsDisplay; var directionsService = new google.maps.DirectionsService(); var map; function initialize() {   directionsDisplay = new google.maps.DirectionsRende