jQuery让div显示在鼠标点击位置


<form class="myForm" id="propertyForm">
    <div class="form_title">
        属性设置
        <span id="close" style="float:right;">X</span>
    </div>
    <div class="form_content">
        <table>
            <tr>
                <td class="th">分支流量低限值:</td>
                <td><input type="text" style="width:120px" id="ele_min"/></td>
            </tr>
            <tr>
                <td class="th">分支流量高限值:</td>
                <td><input type="text" style="width:120px" id="ele_max"/></td>
            </tr>
            <tr>
                <td class="th">制程进度:</td>
                <td><input type="text" style="width:120px" id="ele_schedule"/></td>
            </tr>
            <tr>
                <td class="th">在制品标识类型:</td>
                <td>
                    <select id="ele_logoType">
                        <option value="0">在制品容器标识</option>
                        <option value="1">制品容器标识</option>
                    </select>
                </td>
            </tr>
        </table>
    </div>
    <div class="form_btn_div">
        <input type="reset" value="重置"/>
        <input type="button" value="确定" onclick="alert(demo.$focus)"/>
    </div>
</form>

  下面的是鼠标点击事件中添加的代码:

var div = $("#propertyForm");
                    if (div.is(":hidden")) {
                        div.show();
                        div.css("left", document.body.scrollLeft + event.clientX + 1);
                        div.css("top", document.body.scrollLeft + event.clientY + 10);
                    } else {
                        div.hide();
                    }

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM