找回密码
 注册

QQ登录

只需一步,快速开始

查看: 256|回复: 0

Loading HTML into “floating” DIV with jQuery

[复制链接]
发表于 2013-10-27 02:25:11 | 显示全部楼层 |阅读模式
  1. <html>
  2.   <!-- inlude the jquery lib here..-->
  3.   <script type="text/javascript">
  4.     $(function(){
  5.        $('.record').mouseover(function(e){
  6.           var selectedRecordID = $(this).data('id');
  7.           $("#divDisplayInfo").load("GetRecordInfo.aspx",
  8.                                  { recordID: selectedRecordID },
  9.                                  function(){
  10.                                      $(this).css({left:e.pageX+'px', top:e.pageY+'px'});
  11.                                  });
  12.        });
  13.    });
  14.   </script>
  15.   <style type="text/css">#divDisplayInfo{position:absolute;}</style>
  16.   <body>
  17.    <a href="#" class="record" data-id="1">Record 1</a>
  18.    <a href="#" class="record" data-id="2">Record 2</a>
  19.    <a href="#" class="record" data-id="3">Record 3</a>

  20.    <div id="divDisplayInfo" style="width: 300px"></div>
  21.   </body>
  22. </html>
复制代码
The aspx page "GetRecordInfo.aspx" is a simple ASP.NET page that accepts a post parameter ("recordID") and then displays a table with information matching the parameter.
from: stackoverflow

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )

GMT-8, 2026-4-11 09:29 , Processed in 0.014056 second(s), 16 queries .

Supported by Weloment Group X3.5

© 2008-2026 Best Deal Online

快速回复 返回顶部 返回列表