diff options
Diffstat (limited to 'js/dynamic.js')
-rw-r--r-- | js/dynamic.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/dynamic.js b/js/dynamic.js new file mode 100644 index 0000000..795ba57 --- /dev/null +++ b/js/dynamic.js @@ -0,0 +1,22 @@ +jQuery(function($) { + + + $('.gmap').each(function(){ + + var apiArguments = $(this).find('dt'); + var apiValues = $(this).find('dd'); + + if(apiArguments.length) { + var queryString = 'http://maps.google.com/staticmap?'; + + for(i = 0; i < apiArguments.length; i++) { + queryString = queryString + $(apiArguments[i]).text() + '=' + encodeURIComponent($(apiValues[i]).text()) + '&'; + } + queryString = queryString + 'size=241x370'; + + $(this).append('<img src="'+queryString+'" alt="map">'); + $(this).find('dl').hide(); + } + }); + +});
\ No newline at end of file |