[英]Removing title tag attribute from google map
当用户将鼠标悬停在标记上时,我想完全删除title
标记。 到目前为止,这是我尝试过的。
jQuery("[title]").removeAttr("title");
jQuery("*").removeAttr("title");
都不行。
我也参考了以下解决方案。
但是找不到任何实际上删除标题标签的解决方案。
我已经更新了脚本集属性:title:”。
已更新且有效: http://jsfiddle.net/edf3gwuk/
: http://jsfiddle.net/edf3gwuk/
var infowindow = new google.maps.InfoWindow(); function point(lat, long) { var self = this; self.name = name; var marker = new google.maps.Marker({ position: new google.maps.LatLng(lat, long), title: '', map: map, draggable: true }); google.maps.event.addListener(marker, 'mouseover', function (e) { e.mb.target.removeAttribute('title') //infowindow.setContent(marker.title); //infowindow.open(map, marker); }.bind(this)); google.maps.event.addListener(marker, 'mouseout', function () { infowindow.close(); }.bind(this)); } var map = new google.maps.Map(document.getElementById('googleMap'), { zoom: 5, center: new google.maps.LatLng(55, 11), mapTypeId: google.maps.MapTypeId.ROADMAP }); new point(58, 14);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maps.googleapis.com/maps/api/js?key=&sensor=false"></script> <section id="Map"> <div id="googleMap" style="width:350px;height:600px;"></div> </section>
我的解决方案设置为标签内容为空
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.