本文介绍了如何使用注册的锚标签使用引导模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我的导航栏有一个锚标记列表.单击注册"时,我想打开一个模式.代码如下:
I have a list of anchor tags for my navigation bar. I want to open a modal when "Register" is clicked. Here is the code:
<li><a href="@Url.Action("Login", "Home")">Login</a></li>
<li><a href="#"> data-toggle="modal" data-target="modalRegister"> Register</a></li>
<div id="modalRegister" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title" style="text-align-last: center">Register</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
我通常使用按钮打开模式,但由于 <a href""></a>.我怎样才能达到效果?
I normally use a button to open a modal, but I'm not quite sure how I would open it using the <a></a> tag because of the <a href""></a>. How can I achieve the results?
推荐答案
您将不得不修改以下行:
You will have to modify the below line:
<li><a href="#" data-toggle="modal" data-target="modalRegister">Register</a></li>
modalRegister 是 ID,因此需要前面的 # 用于 html 中的 ID 引用.
modalRegister is the ID and hence requires a preceding # for ID reference in html.
因此,修改后的 html 代码片段如下:
So, the modified html code snippet would be as follows:
<li><a href="#" data-toggle="modal" data-target="#modalRegister">Register</a></li>
这篇关于如何使用注册的锚标签使用引导模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
The End




大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)