亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何從谷歌地圖 div 跳過 tabIndex 并使用 angular8 從一個輸入移動到另一個輸入

如何從谷歌地圖 div 跳過 tabIndex 并使用 angular8 從一個輸入移動到另一個輸入

斯蒂芬大帝 2023-09-04 15:49:47
我有 2 個輸入字段以及 Map div,這里當我切換時,選項卡焦點將從第一個輸入字段轉到地圖內的名稱和鏈接,在傳遞到所有地圖名稱后,它到達第二個輸入字段。我嘗試在地圖函數內將 tabindex 設置為 -1,但沒有任何效果。任何人都可以幫助我,如何使這項工作有效。TS: var map = new window["google"].maps.Map(this.gmapElement.nativeElement, {        center: { lat: 37.1587963, lng: -100.5623315 },        zoom: 2      });      google.maps.event.addListener(map, "titlesLoaded", function() {        [].slice.apply(this.gmapElement.nativeElement).forEach(function(item) {          item.setAttribute("tabindex", "-1");        });HTML: <div class="col" >            <a href="javascript:void(0);" tabindex="-1">View on Map</a>            <div  style="position: relative; overflow: hidden;width:100%;height:400px" #mapRef>            </div>演示版
查看完整描述

1 回答

?
當年話下

TA貢獻1890條經驗 獲得超9個贊

正如我在評論中所說,您只需在 2 個輸入上添加tabindex="1"和即可。tabindex="2"


工作代碼片段:


var map;


function initialize() {


  // Create the map and center on deault location

  map = new google.maps.Map(document.getElementById('map'), {

    center: new google.maps.LatLng(0, 0),

    zoom: 3

  });

}

#map {

  height: 120px;

  width: 100%

}

<input type="text" tabindex="1">


<div id="map"></div>


<input type="text" tabindex="2">


<!-- Replace the value of the key parameter with your own API key. -->

<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initialize" async defer></script>


查看完整回答
反對 回復 2023-09-04
  • 1 回答
  • 0 關注
  • 156 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號