简体   繁体   English

jQuery弹出/需要警报

[英]JQuery pop up/ alert needed

I have a list of elements that need to have a corresponding pop up for each element. 我有一个元素列表,每个元素都需要有一个相应的弹出窗口。 This is not a pop up where the background is blacked. 这不是背景变黑的弹出窗口。 This is more like a javascript alert although I need to create my own styled button within the pop up with our own bespoke event assigned to it. 这更像是JavaScript警报,尽管我需要在弹出窗口中创建自己的样式按钮,并为其分配定制的事件。 I need each pop to position itself appropriately next to the relevant item within the UI. 我需要每个弹出窗口将自己适当地放置在UI中的相关项目旁边。

Whats the best way to do this? 最好的方法是什么? Are there any examples please? 请问有什么例子吗? I only want the pop up to show when the visitor triggers an event. 我只希望在访客触发事件时显示弹出窗口。

Many thanks, 非常感谢,

I suggest you to use Colorbox for pop-up systems. 我建议您将Colorbox用于弹出系统。 Fırst of all; 首先; it is easy to learn and use. 它易于学习和使用。

And most importantly: Colorbox won't create conflicts with your other plugins (sometimes fancybox does that). 最重要的是: Colorbox不会与您的其他插件产生冲突(有时fancybox 会这样做 )。

Some Features: 一些功能:

  • Supports photos, grouping, slideshow, ajax, inline, and iframed content. 支持照片,分组,幻灯片,ajax,嵌入式和iframed内容。
  • Lightweight: 10KB of JavaScript (less than 5KBs gzipped). 轻量级:10KB的JavaScript(压缩后少于5KB)。
  • Appearance is controlled through CSS so it can be restyled. 外观是通过CSS控制的,因此可以重新设置样式。

You can easily do this without using jQuery Plugins. 您无需使用jQuery插件即可轻松完成此操作。

I put together a little example . 了一个小例子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM