如何制作具有不同内容的模态 [英] How to make modals with different content

查看:64
本文介绍了如何制作具有不同内容的模态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一个网站(完成).然后我添加了至少 30 个按钮,当你按下第一个按钮时,一个简单的模式会出现,可以关闭,但是当你按下第二个按钮时,同样的事情发生了!这只是另一个内容.

让我试着用我糟糕的编程语言告诉你.

1

if pressed = "modal1" 打开.

<小时>

2

îf pressed = "modal2" 以不同的内容打开.

我会添加一些代码,但我没有比 Bootstrap 更长的时间:http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_modal&stacked=h

解决方案

如果你使用 Bootstrap modal,你只需要改变所有按钮的 data-target 和 crate modals.

I want to make a website (done). Then I´m adding at least 30 buttons, and when you press the first button, a simple modal comes up with the ability to close, but when you press the second button, the same thing happens! It's just another content.

Let me try to tell you this in my bad programming language.

<div class="button" id="modal1">1</div>

if pressed = "modal1" opens.


<div class="button" id="modal2">2</div> 

îf pressed = "modal2" opens with different content.

I would add some code, but I haven´t got any longer than the Bootstrap: http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_modal&stacked=h

解决方案

If you use Bootstrap modal u need just to change data-target and crate modals for all buttons.

这篇关于如何制作具有不同内容的模态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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