Changes for mobile map
This commit is contained in:
		
							parent
							
								
									e9f2983176
								
							
						
					
					
						commit
						6eb5061237
					
				|  | @ -25,8 +25,8 @@ $('#index').live('pageinit',function(){ | ||||||
| 	$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)}); | 	$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)}); | ||||||
| 	$(this).find(".newpic img").muImageResize({width: 280, height: 200}); | 	$(this).find(".newpic img").muImageResize({width: 280, height: 200}); | ||||||
| 	$('.slideshow').cycle({ | 	$('.slideshow').cycle({ | ||||||
| 		fx:'scrollLeft', | 		fx: $effect, | ||||||
| 		timeout: 6000, | 		timeout: $timeout | ||||||
| 	}); | 	}); | ||||||
| 	$(".newlist").css({ | 	$(".newlist").css({ | ||||||
| 		"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30, | 		"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30, | ||||||
|  | @ -40,8 +40,9 @@ $('#index').live('pageinit',function(){ | ||||||
| $('#announcement_content').live('pageinit',function(){ | $('#announcement_content').live('pageinit',function(){ | ||||||
| 	$(this).find(".newpic img").muImageResize({width: 320, height: 220}); | 	$(this).find(".newpic img").muImageResize({width: 320, height: 220}); | ||||||
| }); | }); | ||||||
| var mobileDemo = { 'center': '24.987449, 121.576117', 'zoom': 17 }; | 
 | ||||||
| $('#map').live('pageinit', function() { | $('#map').live('pageinit', function() { | ||||||
|  | 	var mobileDemo = { 'center': $map_center, 'zoom': $map_zoom }; | ||||||
| 	var $windowH = $(window).height(); | 	var $windowH = $(window).height(); | ||||||
| 	$("#map_canvas").css({ | 	$("#map_canvas").css({ | ||||||
| 		'height' : $windowH, | 		'height' : $windowH, | ||||||
|  | @ -50,7 +51,7 @@ $('#map').live('pageinit', function() { | ||||||
| 		$('#map_canvas').gmap({'center': mobileDemo.center, 'zoom': mobileDemo.zoom, 'disableDefaultUI':false, 'callback': function() { | 		$('#map_canvas').gmap({'center': mobileDemo.center, 'zoom': mobileDemo.zoom, 'disableDefaultUI':false, 'callback': function() { | ||||||
| 			var self = this; | 			var self = this; | ||||||
| 			self.addMarker({'position': this.get('map').getCenter() }).click(function() { | 			self.addMarker({'position': this.get('map').getCenter() }).click(function() { | ||||||
| 				self.openInfoWindow({ 'content': "<%= I18n.t('mobile.location_description') %>" }, this); | 				self.openInfoWindow({ 'content': $info }, this); | ||||||
| 			}); | 			}); | ||||||
| 		}});  | 		}});  | ||||||
| 	}).load('basic_map'); | 	}).load('basic_map'); | ||||||
|  |  | ||||||
|  | @ -23,4 +23,5 @@ | ||||||
| <script type='text/javascript'> | <script type='text/javascript'> | ||||||
|   var $effect = "<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>" |   var $effect = "<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>" | ||||||
|   var $timeout = "<%= @ad_banner.transition_msec %>" |   var $timeout = "<%= @ad_banner.transition_msec %>" | ||||||
|  |   var $info = "<%= t('mobile.location_description').html_safe %>" | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -3,3 +3,8 @@ | ||||||
| <% end %> | <% end %> | ||||||
| 
 | 
 | ||||||
| <div id='map_canvas'></div> | <div id='map_canvas'></div> | ||||||
|  | 
 | ||||||
|  | <script type='text/javascript'> | ||||||
|  |   var $map_center = "24.987449, 121.576117" | ||||||
|  |   var $map_zoom = 17 | ||||||
|  | </script> | ||||||
|  | @ -7,5 +7,5 @@ en: | ||||||
|     home: Home |     home: Home | ||||||
|     language: Language |     language: Language | ||||||
|     location: Location |     location: Location | ||||||
|     location_description: '<h3>國立政治大學</h3>11605 臺北市文山區指南路二段64號' |     location_description: '<h3>National Chengchi University</h3>NO.64,Sec.2,ZhiNan Rd.,Wenshan District,Taipei City 11605,Taiwan (R.O.C)' | ||||||
|     page: Page |     page: Page | ||||||
		Loading…
	
		Reference in New Issue