插件来源:http://www.zhangxinxu.com/wordpress/?p=1328

浮动层功能很强大,用它加ajax实现了鼠标移进数据列表中的数据项时显示每项的详细内容。



test.aspx页面:


<script type="text/javascript">
        $(function () {         
            $(".markSelectBox").powerFloat({
                width: 400,
                offsets: { x: -150, y: 0 },
                eventType: "hover",
                target: "#qmpanel_shadow"
            });    
        });
        function GetDetail(id) {         
            jQuery.post("/ajax/GetMsgDetail.ashx", { id: id },
                   function (data, textStatus) {
                       $("#qmpanel_shadow").html(data);
                   });
        }
</script>



<a href="javascript:void(0)" class="markSelectBox" onmouseover='javascript:GetDetail(<%# Eval("Id")%>)' style="cursor: pointer;">
    <%# Eval("MSubject") %>
</a>



<div style="position: absolute;background: #fff;border: 1px solid #aaa; display: none" >
      加载中。。。
</div>



GetMsgDetail.ashx
页面:


 public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            if (!string.IsNullOrEmpty(context.Request.Params["id"]))
            {
                int id = Convert.ToInt32(context.Request.Params["id"]);
                Message m = IOC.R<IMessage>().Get(id);
                   context.Response.Write(m.MContent);             
            }           
        }

效果:


jQuery powerFloat万能浮动层下拉层插件

相关文章:

  • 2022-12-23
  • 2021-08-19
  • 2021-11-27
  • 2021-10-17
  • 2021-07-15
  • 2022-02-08
猜你喜欢
  • 2022-02-01
  • 2022-12-23
  • 2021-12-31
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案