ASP.net和javascript自动打开灯箱
Im trying to add a light box which automatically opens up when someone visits my homepage. something similar to
any idea on how I can do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
例如,您可以使用 colorbox 来获取在页面加载后打开的灯箱。
从这里下载colorbox:http://colorpowered.com/colorbox/latest,解压文件并修改example1 文件夹中的index.html 文件。
替换:
为
在浏览器中打开index.html 文件即可直接看到灯箱。
You can use for example colorbox to get a lightbox that opens after the page is loaded.
Download colorbox from here: http://colorpowered.com/colorbox/latest, extract the file and modify the index.html file in the example1 folder.
Replace:
with
Open the index.html file in your browser to see the lightbox coming up directly.
您使用母版页吗?您需要在文件中放置 2 个 div。一个具有固定位置或绝对位置并使背景变暗,另一个 div 显示内容。
查看此链接,它是一个网络消息框,但它将使用模板方法执行您想要的操作。
http://www.snippetbank.net /detail/snippetdetail/9-aspcsharp/3-filemanipulation/404-Web-MessageBox.html
are you using a master page?You need to place 2 divs in your file. One that has a fixed position or absolute and dimmer the background, and another div that displays the content.
Check this link out, it is a web messagebox but it will do what you want using a template approach.
http://www.snippetbank.net/detail/snippetdetail/9-aspcsharp/3-filemanipulation/404-Web-MessageBox.html
您可以将以下内容添加到您的主页,
或者您可以将 Jquery 与类似的东西一起使用...
一旦页面加载,以上两者都会触发灯箱。使用 jquery 示例可能更好,因为这将确保 DOM 已准备就绪。
You can add the following to your home page
Or you can use Jquery all together with something like...
both of the above will fire the lightbox once the page is loaded. Its probably better to use the jquery example as this will ensure that the DOM is ready.