鼠标悬停时显示 jQuery 弹出窗口
在 ASPX 页面中,我希望在鼠标悬停完成的位置的关闭 xy 坐标内显示弹出窗口(类似于 Windows 状态栏,当我们将鼠标悬停在 Outlook 上时,它会在旁边显示一些内容。)
所以在我的 ASPX 页面中,目前我有jquery 在页面中央显示对话框(它将 ASPX 页面屏蔽为全白,然后将实际内容显示为弹出窗口),但我想显示更靠近鼠标悬停的弹出窗口,而不屏蔽aspx 页面。
ASPX 页面很少有 jquery 参考。 下面是 ASPX 页面。
<asp:Content ContentPlaceHolderID="PageScript" runat="server">
<div class="inline">
<a href="#" tabindex="-1" class="question-quality"></a>
<span>Quality:</span>
</div>
<div id="dialog_product-quality" class="dialog-content" style="display: none;">
<div class="dialog-content-padding">
<p>
<asp:Literal runat="server" ID="ProductQualityContentText" />
</p>
</div>
</div>
<link type="text/css" href="/store/javascript/css/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="/javascript/jquery.ui.core.js"></script>
<script type="text/javascript" src="/javascript/jquery.ui.widget.js"></script>
<script type="text/javascript" src="/javascript/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="/javascript/jquery.ui.slider.js"></script>
<script type="text/javascript" src="/javascript/jquery151.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('div#dialog_product-quality').dialog(dialog_options);
$('a.Quality').hover(function(e){
e.preventDefault();
openDialogWindow('div#dialog_product-quality', 'Product Quality');
});
</script>
</asp:Content>
请建议。
谢谢。
Within an ASPX page, I would like to have the popup shown within the closes xy coordinate of where mousehover is done (similar to windows status bar where when we mousehover outlook it shows something next to it. )
So in my ASPX page currently I have the jquery that shows the dialog in the center of the page (it masks the ASPX page into whole white and then displays the the actual content as a popup window) but I would like to show the popup closer to the mousehover without masking the aspx page.
The ASPX page has few jquery references.
Below is the ASPX page.
<asp:Content ContentPlaceHolderID="PageScript" runat="server">
<div class="inline">
<a href="#" tabindex="-1" class="question-quality"></a>
<span>Quality:</span>
</div>
<div id="dialog_product-quality" class="dialog-content" style="display: none;">
<div class="dialog-content-padding">
<p>
<asp:Literal runat="server" ID="ProductQualityContentText" />
</p>
</div>
</div>
<link type="text/css" href="/store/javascript/css/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="/javascript/jquery.ui.core.js"></script>
<script type="text/javascript" src="/javascript/jquery.ui.widget.js"></script>
<script type="text/javascript" src="/javascript/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="/javascript/jquery.ui.slider.js"></script>
<script type="text/javascript" src="/javascript/jquery151.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('div#dialog_product-quality').dialog(dialog_options);
$('a.Quality').hover(function(e){
e.preventDefault();
openDialogWindow('div#dialog_product-quality', 'Product Quality');
});
</script>
</asp:Content>
Please suggest.
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
引用OP:
jQuery 插件 qTip2 将为您提供让弹出工具提示或模式框跟随鼠标指针的选项(如果这是您所要求的)。请参阅下面的鼠标跟踪演示。
http://craigsworks.com/projects/qtip2/demos/#mouse
jsFiddle 演示与代码
下载并包含 qTip2 JavaScript 和CSS 文件。
Quote OP:
jQuery plugin, qTip2, will give you the option of having the popup tooltip or modal box follow the mouse pointer, if that's what you're asking. See mouse tracking demo below.
http://craigsworks.com/projects/qtip2/demos/#mouse
jsFiddle Demo with Code
Download and include the qTip2 JavaScript & CSS files.