名單,這是我的HTML,如何使用地圖功能使用Javascript或Jquery的
<div id="container" class="myGal" tabindex="5001" style="overflow: hidden; outline: none;">
<select id="Select1" style="display:none" multiple="multiple" data-limit="7" wtx-context="5C3D486B-FBBF-4191-BDA3-C2F28323036B">
<option></option>
<option data-img-src="" value="728" data-img-label="10"></option>
<option data-img-src="" data-img-label="11"></option>
<option data-img-src="" value="730" data-img-label="12"></option>
</select>
<ul class="thumbnails image_picker_selector">
<li>
<div class="thumbnail selected"><img class="image_picker_image loaded" src="http://localhost:1344//ARTSQLDATA/PTDIR/170629062/Pictures/Personal_Picture/170629062_4353_4a97162c-7350-43eb-82df-6e92f49b30bb.jpg?w=90&h=90&mode=max"></div>
</li>
<li>
<div class="thumbnail"><img class="image_picker_image loaded" src="http://localhost:1344//ARTSQLDATA/PTDIR/170629062/Pictures/Personal_Picture/170629062_4353_bb197250-91ab-449e-9cd0-3f69ef3a7353.jpg?w=90&h=90&mode=max"></div>
</li>
<li>
<div class="thumbnail selected"><img class="image_picker_image" src="http://localhost:1344//ARTSQLDATA/PTDIR/170629062/Pictures/Personal_Picture/170629062_4353_8eb91587-f229-46f4-af1e-7327cb81a25e.jpg?w=90&h=90&mode=max"></div>
</li>
</ul>
</div>
有具有關聯列表的select
控制。我要地圖並獲得具有thumbnail selected
類
我想這一切的圖像源,但我得到一個空數組,
var list = $('.thumbnail').map(function() { return $(this).closest("img").attr("src"); }).get();
console.log(list.join(','))
您可以在代碼中包含換行符以方便閱讀。 – Difster
我現在就添加它。 – JSON