根据鼠标位置,动态设置easyui 新打开的window位置
动态设置easyUI window位置。 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Basic Panel - jQuery EasyUI Demo</title> <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="../../themes/icon.css"> <link rel="stylesheet" type="text/css" href="../demo.css"> <script type="text/javascript" src="../../jquery.min.js"></script> <script type="text/javascript" src="../../jquery.easyui.min.js"></script> </head> <body> <div id="target" class="easyui-window" title="title" closed="true" resizable="false" collapsible="false" minimizable="false" maximizable="false" style="width:500px;height:450px; display: none; "> </div> <button type="button" onclick = "openWindow()">打开窗口</button> <script> var openWindow = function(){ var e = event || window.event; var x = e.clientX; var y = $(document).scrollTop() + 50 ; $('#target').window({ left: x + "px", top: y + "px" }); $('#target').window('open'); } </script> </body> </html>