im'trying here bind vclick event on div in gmap, on click (or touch) changes page map page. when add code
$map.vclick(function(){ $.mobile.changepage($('#map_directions')); )};
gmap won't show , div not clickable (i've tried
$map.bind('vclick', function(e) { $(event.target).trigger('touchstart'); $.mobile.changepage($('#map_directions')); });
also
here's code:
$(document).delegate('#info','pagecreate',function(){ var selectedoptionclass = $('option:selected').attr('class'); $('div.ui-select').addclass(selectedoptionclass); $('#note_utilisateur').live('change', function(){ $('div.ui-select').removeclass(selectedoptionclass); selectedoptionclass = $('option:selected').attr('class'); $('div.ui-select').addclass(selectedoptionclass); }); var $map = $("#info div:jqmdata(role=place_map)"); $map.vclick(function(){ $.mobile.changepage($('#map_directions')); )}; $map.gmap({ maptypecontrol: false, zoomcontrol: false, pancontrol: false, scalecontrol: false, streetviewcontrol: false, latitude:43.320204, longitude:21.892635, zoom: 15, oncomplete: function() { $map.gmap('addmarker', { latitude:43.320204, longitude:21.892635, title:'gnezdo', }); } });
});
and html:
<div class="ui-block-b" id = "place_map" data-role ="place_map" style="width:150px";> loading map.. <div>
i think should use .on()-method in following example:
$( document ).on( "vclick", "#map", function() { ... sth ... });
Comments
Post a Comment