您的位置:首页 > 其它

一个跟随鼠标移动的DIV

2012-01-10 10:41 519 查看
 
 $(".personList td img").each(function () {

                var xOffset = 0;

                var yOffset = 0;

                var $this = $(this);

                var eid = $this.next().attr("alt");

                $this.hover(

                    function (e) {

                        var str=getPersonnel(eid);

                       

                        $("#boxM").css(

                        {

                            "top": (e.pageY - xOffset) + "px",

                            "left": (e.pageX + yOffset) + "px"

                        }

                        ).fadeIn("slow"); ;

                    },

                    function () {

                        $("#boxM").fadeOut("slow");

                    }

                );

            });

        });

 function getPersonnel(eid) {

       $.post("/Ashx/AsynLoad.ashx", { "Action": "LoadPersonnel", "eid": eid },

        function (data) {

        $("body").append("<div id='boxM'>" + data + "</div>");

});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  div function action