简体   繁体   English

BootStrap SharePoint主页中的popover()

[英]popover() in BootStrap SharePoint master page

I am new to BootStrap/jQuery and relatively new to SP 2010 branding. 我是BootStrap / jQuery的新手,而SP 2010的品牌才是新手。

I am trying to get a popover work in my master page with no luck. 我试图在我的主页上完成一个popover工作,但是没有运气。 I am not sure what I'm missing here. 我不确定我在这里缺少什么。 This is the code I'm trying to get working in my page. 这是我正在页面上尝试使用的代码。

HTML: HTML:

<div class="well">
    <p>
        <a href="#" id="hoverOver" class="btn btn-danger " rel="popover" 
            data-original-title="Example PopOver" 
            data-content="BootStrapping SharePoint aren't we now!" 
            data-placement="top">Hover Over Me!
        </a>
    </p>
</div>

JavaScript: JavaScript:

$(document).ready((function() {
    $('#hoverOver').popover();
}

CSS: CSS:

.well{
    margin-left:40px;
} 

JSFIDDLE: http://jsfiddle.net/kKAtN/ JSFIDDLE: http : //jsfiddle.net/kKAtN/

I have bootstrap.js, bootstrap.min and jquery-1.8.3.min in the following folder: 我在以下文件夹中包含bootstrap.js,bootstrap.min和jquery-1.8.3.min:

C:\\Program Files\\Common Files\\Microsoft Shared\\Web Server extensions\\14\\TEMPLATE\\LAYOUTS\\TwitterBootStrapMasterPage\\js C:\\ Program Files \\ Common Files \\ Microsoft共享\\ Web服务器扩展\\ 14 \\ TEMPLATE \\ LAYOUTS \\ TwitterBootStrapMasterPage \\ js

How would I get the popover to work? 我将如何使弹窗工作?

  1. You will need to edit the site's master page titled v4.master. 您将需要编辑站点的主页v4.master。
  2. Add the reference to your Jquery library, and any additional code libraries including Bootstrap or CSS stylesheets. 将引用添加到您的Jquery库以及任何其他代码库(包括Bootstrap或CSS样式表)中。
  3. To apply popovers, do that editing on a page you want features to appear on. 要应用弹出窗口,请在要显示功能的页面上进行编辑。
  4. Create an html file with custom tags and css where you can edit the content of a popover. 使用自定义标记和CSS创建一个html文件,您可以在其中编辑弹出式窗口的内容。
  5. For example, on your home page you want to have a popover on a header item. 例如,在您的主页上,您希望在标题项目上有一个弹出框。
  6. Place a Content Editor web part on your page and link it to the html file with custom css tags. 将内容编辑器Web部件放在页面上,并将其链接到带有自定义css标记的html文件。
  7. Save the page and preview. 保存页面并预览。
  8. The source code libraries live in your master page, and are available to any page. 源代码库位于您的母版页中,并且可用于任何页面。
  9. Anywhere you edit code in a Sharepoint page, should recognize the use of Jquery and Bootstrap functions. 在Sharepoint页面中编辑代码的任何地方,都应该认识到Jquery和Bootstrap函数的使用。

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

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