简体   繁体   English

jQuery模式没有正确交互

[英]jQuery modal not interacting properly

I have a jQuery modal that appears on top of an OpenLayers map. 我有一个jQuery模式出现在OpenLayers地图之上。 When I try to control the modal, it ignores the modal and controls the map. 当我尝试控制模态时,它会忽略模态并控制地图。 I can only control the region which is outside of the map. 我只能控制地图之外的区域。 How can I fix this problem? 我该如何解决这个问题?

Thanks! 谢谢!

function init_editor() {

$( '#widthColor' ).colorPicker();
$( '#fillColor').colorPicker();
$( "#slider" ).slider({
    value:1,
    min: 1,
    max: 5,
    step: 1,
    slide: function( event, ui ) {
        $( "#amount" ).val(  ui.value );
    }
});

$( "#transparency" ).slider({
    value: 0.5,
    min: 0.1,
    max: 1,
    step: 0.1,
    slide: function( event, ui ) {
        $( "#trans_val" ).val( ui.value );
    }
});

$( "#amount" ).val(  $( "#slider" ).slider( "value" ) );
$( "#trans_val" ).val(  $( "#transparency" ).slider( "value" ) );

//Map KML editor modal
var dlg = $( "#layer-manager" ).dialog({
    modal: true,
    width: 300,
    height: 300,
    autoOpen: false,
    buttons: {
        Ok: function( e ) {
            e.preventDefault();
            setColor( $('#widthColor').val(), $('#fillColor').val(), $('#amount').val(), $('#trans_val').val() );
            $( this ).dialog( "close" );
        }
    }
}); 

//Register the modal
$(document).on("click", "a.layer-manager", function(e){
    $( "#layer-manager").dialog( "open" );
});
}

Also the site http://uganda.csrcdev.com/map/ 该网站也是http://uganda.csrcdev.com/map/

You need to add: 你需要添加:

function init_editor() {

$( "#layer-manager").css('z-index','1000');

Then the modal will be a top level element. 然后模态将是顶级元素。 Right now it is hiding behind everything else. 现在它隐藏在其他一切之后。

Open firebug and locate the dialog near the bottom. 打开firebug并找到靠近底部的对话框。 Then give it the z-index: 1000; 然后给它z-index: 1000; to see it work before you make the change. 在做出改变之前看它是否有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM