如何使用鼠标悬停在动态创建的按钮上显示图像弹出窗口 [英] how to display an image popup on dynamically created buttons with mouseover

查看:69
本文介绍了如何使用鼠标悬停在动态创建的按钮上显示图像弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个动态创建按钮的Web应用程序。它可以创建多达120个按钮,具体取决于底层数据库。当鼠标悬停在按钮上几秒钟时,我正在寻找制作带有产品图像的面板弹出窗口的最佳方法。我想过使用悬停扩展器,但在阅读了几个关于性能问题的线程后,我确定这是否是最好的解决方案。我愿意接受任何有关这项工作的建议。感谢您抽出时间回答我的问题。

解决方案

使用ajaxcontrol工具包,你有这个扩展控件来执行此操作


< blockquote>我在这里有样品



http://www.asp .net / ajaxlibrary / AjaxControlToolkitSampleSite / [ ^ ]






下载工具包




http://ajaxcontroltoolkit.codeplex.com/ [ ^ ]





玩得开心快乐


您可以使用 jQuery Dialog [ ^ ]。



动态创建按钮时,添加一个 CssClass 属性给它们并提供所有按钮共有的类名。



然后在 JavaScript 上,使用类选择器选择这些按钮并提高他们的 onmouseover 事件,并在活动内打开对话框。



查看一个示例 - 按钮上的打开jQuery模态弹出窗口在ASP.Net中 [ ^ ]。在此处打开按钮上的对话框单击并按ID选择按钮。您只需要通过类选择器替换它, onmouseover 点击事件。


I have a web application that creates buttons dynamically. It can create up to 120 buttons depending on the underlying database. I am looking for the best way to make a panel popup with an image of the product when the mouse hovers over the button for a few seconds. I thought about using the hover extender but after reading a few threads on performance issues I a mot sure if that will be the best solution. I am open to any suggestions to make this work. Thank you in advance for your time in answering my question.

解决方案

use ajaxcontrol toolkit and u have this extension control to perform this


uve got sample here

http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/[^]


download the toolkit from


http://ajaxcontroltoolkit.codeplex.com/[^]


have fun happy week


You can use jQuery Dialog[^].

While creating Buttons dynamically, add one CssClass attribute to them and provide a class name common to all the Buttons.

Then on JavaScript, use class selector to select these Buttons and raise their onmouseover event and inside the event open the Dialog.

See one example - Open jQuery Modal Popup Window on Button Click in ASP.Net[^]. Here it opens the Dialog on Button Click and selects the Button by ID. You just need to replace that by class selector and click event by onmouseover.


这篇关于如何使用鼠标悬停在动态创建的按钮上显示图像弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆