0

我在http://jsfiddle.net/xBJeV/6/添加了我的代码跟踪。我需要一些帮助 1. 在对话框中选择值而不消失对话框。2.当鼠标离开div时,对话框应该关闭。

提前致谢

<div class="editionDetailAction">Action for Item 1</div>
<div class="editionDetailAction">Action for Item 2</div>
<div class="editionDetailAction">Action for Item 3</div>
<div class="editionDetailAction">Action for Item 4</div>



<div id="actionsPopup">
    <ul><li><a href="http://www.google.com">Add xyz</a></li></ul>
    <ul><li>Manage xyz</li></ul>
    <ul><li>Show xyz</li></ul>
</div>

jQuery代码

$(document).ready(function () {
    $('.editionDetailAction').click(function (e) {
        $("#actionsPopup").dialog("option", { position: [e.pageX+5, e.pageY+5] });
    });

    $("#actionsPopup").dialog({
            autoOpen: false,  
dialogClass: 'actionsPopup',
        maxWidth:100,
                    maxHeight: 100,
                    width: 200,
        height: 80,
resizable: false,


    });
    $(".editionDetailAction").bind("click", function () {
        $("#actionsPopup").dialog('open'); 
    });
    $(".editionDetailAction").bind("mouseleave", function () {
        $("#actionsPopup").dialog('close'); 
    });

   });

我的 CSS

.editionDetailAction { width: 150px; height: 30px; border: solid 1px #ddd; }
.actionsPopup .ui-dialog-titlebar { display:none; }
4

1 回答 1

0

Thanks for your time guys... I added below code and its working for me. Just want to post solution so that others can get benefit out of similar issue....

$(".actionsPopup").bind("mouseover", function () {
        $("#actionsPopup").dialog('open');
    });
于 2012-12-10T22:04:15.437 回答