简体   繁体   English

引导程序中的弹出窗口

[英]Popover in Bootstrap

I want to provide a set of additional information in my bootstrap template. 我想在我的引导模板中提供一组其他信息。 I want to have a set of terms and conditions with a plain english popover for certain key terms. 我想要一套条件和条件,其中包含一些关键术语的普通英语弹出框。

I've included all the correct links to the CDN and I get a popup from just the below code but when I view it as a whole page this stops working and just sends me back to the top of the page. 我已经包含了指向CDN的所有正确链接,并且仅从以下代码获得弹出窗口,但是当我将其作为一个整体查看时,它将停止工作,只是将我发送回页面顶部。 Is there something that I need to bear in mind when doing this? 执行此操作时,我需要记住什么吗? I've spent days trying to tweak this to work? 我已经花了几天时间尝试调整此功能?

Thank you 谢谢

 <!-- jQuery --> <script src="vendor/jquery/jquery.min.js"></script> <script src="js/popover.js"></script> <!-- Plugin JavaScript --> <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script> <aside class="bg-dark"> <div class="container text-center"> <h2>An example of what we will do</h2> <hr class="light"> <a href="#" data-toggle="popover" title="Popover Header" data-content="Some content inside the popover">Toggle popover</a> </div> </aside> <script> $(document).ready(function() { $('[data-toggle="popover"]').popover(); }); </script> 

You didn't set right the CDN file. 您没有正确设置CDN文件。 Please set the right path to the jquery library and try to remove the file jquery.slim if it's not required. 请为jquery库设置正确的路径,如果不需要,请尝试删除文件jquery.slim

Checkout the snippet 检出片段

 $('[data-toggle="popover"]').popover(); 
 <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <aside class="bg-dark"> <div class="container text-center"> <h2>An example of what we will do</h2> <hr class="light"> <a href="#" data-toggle="popover" title="Popover Header" data-content="Some content inside the popover">Toggle popover</a> </div> </aside> 

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

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