gpt4 book ai didi

javascript - jQuery Mobile - slider 无法移动

转载 作者:行者123 更新时间:2023-11-28 16:31:41 25 4
gpt4 key购买 nike

我正在使用 jQuery slider ,但我无法移动 handle 。

HTML 结构:

<div id="map" class="map" style="position: relative;">
<div id="legend" class="legend" style="position: absolute; top: 0px; right: 0px; width:300px; z-index: 100;">
<div style="width:290px; height: 150px; padding: 5px;">
<label class="checkbox-label"><input name="gai_max_V" id="gai_max_V" class="runoff" type="checkbox"><image src="icons/icona_land_use.png"/><p id="legend_text">Soil Runoff Capacity (1955)</p></input></label>
<div id="div-slider">
<input type="range" name="slider-1" id="slider-1" value="80" min="20" max="100" step="20" data-highlight="true">
</div>
<div style="width:290px; height: 150px; padding: 5px;">...</div>
<div style="width:290px; height: 150px; padding: 5px;">...</div>
</div>
</div>

jQuery Mobile 版本是 1.4.5 并且 map,也就是父 div 的内容是由 Leaflet 创建的:

var map = L.map('map', {
center: [45.81, 9.1],
zoom: 15
});

你能猜出为什么我不能移动 handle 吗?

谢谢,

伊路尔

最佳答案

您可以使用小型 css hack 解决此问题。

演示:https://jsfiddle.net/u2j24x25/2/

<!-- Insert this part after MAP --> 
<div id="div-slider"><input type="range" name="slider-1" id="slider-1" value="80" min="20" max="100" step="20" data-highlight="false"></div>

/* CSS */
#map { height: 380px; } #div-slider {z-index:99999999;border:1px solid red;} #div-slider {position:relative;top:-250px;width:300px;float:right}

编辑:将 div#legend 放在 div#map 之后将解决该问题。

演示:https://jsfiddle.net/u2j24x25/4/

<div id="map" class="map" style="position: relative;">
</div>

<div id="legend" class="legend" style="position: absolute; top: 0px; right: 0px; width:300px; z-index: 100;">
<div style="width:290px; height: 150px; padding: 5px;">
<label class="checkbox-label">
<input name="gai_max_V" id="gai_max_V" class="runoff" type="checkbox"><image src="icons/icona_land_use.png"/><p id="legend_text">Soil Runoff Capacity (1955)</p></input></label>
<div id="div-slider">
<input type="range" name="slider-1" id="slider-1" value="80" min="20" max="100" step="20" data-highlight="true">
</div>
<div style="width:290px; height: 150px; padding: 5px;">...</div>
<div style="width:290px; height: 150px; padding: 5px;">...</div>
</div>
</div>

/* CSS */
#map { height: 380px; }

关于javascript - jQuery Mobile - slider 无法移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35229134/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com