在将缩略图链接到模态时遇到问题
facing problems while linking thumbnails to modals
我正在尝试使用以下代码链接我使用引导程序框架(javascript)模式创建的thumbail。
<html>
<head>
<link href="E:'bootstrap'css'bootstrap.min.css">
</head>
<body>
<!--thumbnail section-->
<section class="container">
<div class="row add-bottom text-center">
<a href="#migrant" class="thumbnail thumbnailstyle" data-toggle="modal">
<img src="E:'Images'migrant100.jpg" alt="Project Image" class="imgStyle img-responsive center-block">
</a>
<br/>
<br/>
<a href="#water" class="thumbnail thumbnailstyle" data-toggle="modal">
<img src="E:'Images'water.jpg" alt="Project Image1" class="imgStyle img-responsive center-block" id="img2">
</a>
</div>
</section>
<!--Modal-->
<div id="migrant" class="modal fade hide" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x
<button>
<h3>Migants</h3>
</div>
<div class="modal-body">
<p>
<img src="E:'Images'migrant100.jpg" alt="migrant01" class="pull-right">The Grapes of Wrath is an American realist novel written by John Steinbeck and published in 1939. The book won the National Book Award and Pulitzer Prize for fiction, and it was cited prominently when Steinbeck was awarded the Nobel Prize in 1962</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div>
</div>
<div id="water" class="modal hide fade" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Water</h3>
</div>
<div class="modal-body">
<p>
<img src="E:'Images'water.jpg" alt="water01" class="pull-right">The Orchidaceae are a diverse and widespread family of flowering plants, with blooms that are often colourful and often fragrant, commonly known as the orchid family. Along with the Asteraceae, they are one of the two largest families of flowering
plants. The Orchidaceae have about 27,800 currently accepted species, distributed in about 880 genera</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div>
</div>
<script src="E:'bootstrap'js'bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js">
</script>
</body>
</html>
当我点击特定的图像缩略图时,什么都没有发生。我刚开始使用bootstrap这样的框架,所以我真的不知道我定义的模态类(模态、模态头、模态体等)是否也需要包含在css文件中。我也做了定制。但是,我没有得到任何结果。
任何建议都将不胜感激。
为了让你的bootstrap pop正常工作,你基本上需要jquery库、bootstap js和bootstrap css。下面的片段将帮助您实现它。
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel='stylesheet' type='text/css' />
你的缩略图部分应该是:
<!--thumbnail section-->
<section class="container">
<div class="row add-bottom text-center">
<a href="#migrant" class="thumbnail thumbnailstyle" data-toggle="modal">
<img src="~/Images/migrant100.jpg" alt="Project Image" class="imgStyle img-responsive center-block">
</a>
<br />
<br />
<a href="#water" class="thumbnail thumbnailstyle" data-toggle="modal">
<img src="~/Images/water.jpg" alt="Project Image1" class="imgStyle img-responsive center-block" id="img2">
</a>
</div>
</section>
您的模态内容:
<div class="modal fade" id="migrant" role="dialog">
<div class="modal-dialog">
<button type="button" class="close" data-dismiss="modal">×</button>
<div class="modal-content">
<div class="modal-header">
<h3>Migants</h3>
</div>
<div class="modal-body">
<div class="modal-footer txt_center">
<p>
<img src="~/Images/migrant100.jpg" alt="migrant01" class="pull-right">The Grapes of Wrath is an American realist novel written by John Steinbeck and published in 1939. The book won the National Book Award and Pulitzer Prize for fiction, and it was cited prominently when Steinbeck was awarded the Nobel Prize in 1962
</p>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="water" role="dialog">
<div class="modal-dialog">
<button type="button" class="close" data-dismiss="modal">×</button>
<div class="modal-content">
<div class="modal-header">
<h3>Water</h3>
</div>
<div class="modal-body">
<div class="modal-footer txt_center">
<p>
<img src="~/Images/water.jpg" alt="water01" class="pull-right">The Orchidaceae are a diverse and widespread family of flowering plants, with blooms that are often colourful and often fragrant, commonly known as the orchid family. Along with the Asteraceae, they are one of the two largest families of flowering
plants. The Orchidaceae have about 27,800 currently accepted species, distributed in about 880 genera
</p>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
相关文章:
- 我想使用模态通过php文件发送邮件,并且我希望在提交关闭后关闭pop
- 打开一个模态并将其链接到AngularJS中的指令
- SemanticUI模态not onDeny/onApprove事件未激发
- 有没有比在app.js上绑定模块名称更好的方法来动态加载视图模型和视图以显示模态
- 如何通过所选索引(AngularJS)在模态弹出窗口中显示数据
- 包含数据库中相关信息的开放模态
- bootstrap消除模态并显示另一个模态
- 模态提示-如何重写此代码
- 模态框无法正常工作
- 将数据传递给由服务创建的Ionic模态
- iframe模态无法关闭
- 点击AngularJS模态窗口捕捉背景事件
- jqueryajax调用是复制url,当在模态视图之后在外部js文件中进行调用时
- 使用模态对话框(JQuery)编辑函数
- 如何在模态实例中使用filter
- 在将缩略图链接到模态时遇到问题
- 从谷歌地图自定义控件打开离子模态时遇到问题
- 通过Angular UI模态更新复杂模型时遇到麻烦
- 在张贴“笔记”时遇到了很多麻烦.字段添加到数据库中,同时使用子模态特性
- 使用 AJAX 和 Jquery 将模态表单内容发送到 PHP 文件时遇到问题