SharePoint 2013 Pop-Up Dialogs
转:http://blog.csdn.net/tristan_dong/article/details/19076315
自定义弹出框
一. 项目需求: 自定义弹出框,包括弹出框的内容和样式。
说明: 母版页包括站点母版页和系统母版页,一般我们自定义的母版页只需应用到站点上,而弹出框应用的母版是系统母版,所以,如果你的站点自定义母版没有设置为系统母版,那么弹出框就会和你站点风格有差异,解决方法:设置你的自定义母版为系统母版或者修改弹出框样式。
二. 步骤:
1. 准备工作:
a. 点击按钮:这里用<a>标签:
- <a href="http://www.baidu.com" class="dialog-pop">Show Me the Pop-Up</a>
<a href="http://www.baidu.com" class="dialog-pop">Show Me the Pop-Up</a>
b. 弹出框内容:可以自定html文件,上传到sharepoint站点。这里我直接用“http://www.baidu.com”
c. 弹出框样式: 自定义CSS文件
- <style>
- .ms-dlgOverlay {
- background-color: #333;
- }
- .ms-dlgContent {
- border: 0;
- }
- .ms-dlgBorder {
- border: 1px solid #333;
- }
- .ms-dlgTitle {
- background-color: #333;
- }
- .ms-dlgTitleText {
- display: block;
- font-weight: bold;
- font-size: 13px;
- padding: 7px;
- }
- </style>
<style>
.ms-dlgOverlay {
background-color: #333;
}
.ms-dlgContent {
border: 0;
}
.ms-dlgBorder {
border: 1px solid #333;
}
.ms-dlgTitle {
background-color: #333;
}
.ms-dlgTitleText {
display: block;
font-weight: bold;
font-size: 13px;
padding: 7px;
} </style>
d. js代码:我重写OpenPopUpPage方法,给jQuery库添加自定义函数sharePop,方便以后直接调用。
注意:原本只需简单的调用该方法就可以实现同样的效果,如下蓝色字体
// <a href="javascript:OpenPopUpPage('http://www.baidu.com');">Show Me the Pop-Up!</a>
- <script>
- (function($){
- $.fn.sharePop = function(){
- if(typeof OpenPopUpPage == 'function'){
- return this.each(function(i){
- if($(this).attr('href') != null){
- $(this).click(function(e){
- e.preventDefault();
- OpenPopUpPage($(this).attr('href'));
- });
- }
- });
- }
- else{
- return false;
- }
- };
- })(jQuery);
- $(document).ready(function(){
- $('.dialog-pop').sharePop();
- });
- </script>
<script>
(function($){
$.fn.sharePop = function(){
if(typeof OpenPopUpPage == 'function'){
return this.each(function(i){
if($(this).attr('href') != null){
$(this).click(function(e){
e.preventDefault();
OpenPopUpPage($(this).attr('href'));
});
}
});
}
else{
return false;
}
};
})(jQuery);
$(document).ready(function(){
$('.dialog-pop').sharePop();
});
</script>
e. 调用实例:
- $(document).ready(function(){
- $('.dialog-pop').sharePop();
- });
$(document).ready(function(){
$('.dialog-pop').sharePop();
});
三. 结果演示:

四. 源码
注意:只需把下面代码加入Script Webpart即可
- <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
- <script>
- (function($){
- $.fn.sharePop = function(){
- if(typeof OpenPopUpPage == 'function'){
- return this.each(function(i){
- if($(this).attr('href') != null){
- $(this).click(function(e){
- e.preventDefault();
- OpenPopUpPage($(this).attr('href'));
- });
- }
- });
- }
- else{
- return false;
- }
- };
- })(jQuery);
- $(document).ready(function(){
- $('.dialog-pop').sharePop();
- });
- </script>
- <style>
- .ms-dlgOverlay {
- background-color: #333;
- }
- .ms-dlgContent {
- border: 0;
- }
- .ms-dlgBorder {
- border: 1px solid #333;
- }
- .ms-dlgTitle {
- background-color: #333;
- }
- .ms-dlgTitleText {
- display: block;
- font-weight: bold;
- font-size: 13px;
- padding: 7px;
- }
- </style>
- <a href="http://www.baidu.com" class="dialog-pop">View Content</a>
- <br/>
SharePoint 2013 Pop-Up Dialogs的更多相关文章
- [转]Installing SharePoint 2013 on Windows Server 2012 R2
转自:http://www.avivroth.com/2013/07/09/installing-sharepoint-2013-on-windows-server-2012-r2-preview/ ...
- Fix Internet Explorer Crashes with SharePoint 2013 Online Presence Indicators
IE中,只要是鼠标浮动到人名字上面的状态的时候,这个状态是与Lync相连接的,IE就会出现停止工作. 以下是解决方法. Until the other day when I figured this ...
- SharePoint 2013 create workflow by SharePoint Designer 2013
这篇文章主要基于上一篇http://www.cnblogs.com/qindy/p/6242714.html的基础上,create a sample workflow by SharePoint De ...
- Install and Configure SharePoint 2013 Workflow
这篇文章主要briefly introduce the Install and configure SharePoint 2013 Workflow. Microsoft 推出了新的Workflow ...
- SharePoint 2013 configure and publish infopth
This article will simply descript how to configure and publish a InfoPath step by step. Note: To con ...
- 沙盒解决方案解决SharePoint 2013 以其他身份登陆的问题
众所周知,SharePoint 2013没有像SharePoint 2010那样有一个叫"以其他身份登录"的菜单项. 当然解决方案也很多,比如你可以直接修改Welcome.ascx ...
- 实现一个基于 SharePoint 2013 的 Timecard 应用(中)
门户视图 随着 Timecard 列表的增多,如何查找和管理这许多的 Timecard 也就成了问题.尤其对于团队经理而言,他除了自己填写的 Timecard,还要审核团队成员的 Timecard 任 ...
- 实现一个基于 SharePoint 2013 的 Timecard 应用(上)
在 SharePoint 2013 上面实现一个 Timecard 应用的想法来自一个真实的需求,而实现的方案在我脑海里面盘旋已经很久了,终于这几天准备安排点儿时间将它实现出来. “ We start ...
- SharePoint 2013 Designer 入门教程
SharePoint的使用中,SharePoint Designer是非常重要的工具,我们可以通过Designer设计页面.母版页,维护.管理站点,也可以定制列表表单.数据视图,设计工作流等等.下面总 ...
- SharePoint 2013 开发教程
做了SharePoint有三年了,大家经常会问到,你的SharePoint是怎么学的,想想自己的水平,也不过是初级开发罢了.因为,SharePoint开发需要接触的东西太多了,Windows操作系统. ...
随机推荐
- csu 1306 Manor(优先队列)
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1306 1306: Manor Time Limit: 1 Sec Memory Limit: 1 ...
- 山东省第四届ACM大学生程序设计竞赛解题报告(部分)
2013年"浪潮杯"山东省第四届ACM大学生程序设计竞赛排名:http://acm.upc.edu.cn/ranklist/ 一.第J题坑爹大水题,模拟一下就行了 J:Contes ...
- 通过android.provider包查看android系统定义的provider.
原先的2.2的android源码已经不是那么容易找到了,我稍稍搜索了下找到了一两个没速度的死链就失去了兴趣.不过还好忽然发现在android.provider包下包含了常见的provider的使用方法 ...
- 团体程序设计天梯赛-练习集L1-014. 简单题
L1-014. 简单题 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 这次真的没骗你 —— 这道超级简单的题目没有任何输入. ...
- html5移动web开发实战必读书记
原文 http://itindex.net/detail/50689-html5-移动-web 主题 HTML5 一.配置移动开发环境 1.各种仿真器.模拟器的下载安装 http://www.mob ...
- struts2 action中传递两个参数到url
<action name="outInDetail" class="formManage_outInDetailAction"> <resul ...
- http://jingyan.baidu.com/article/7908e85c74d85faf491ad260.html
http://jingyan.baidu.com/article/7908e85c74d85faf491ad260.html
- HashTable、HashMap、LinkedHashMap、TreeMap的比较
HashTable:继承自Dictionary类,实现了Map接口,不允许键或值为空,线程同步: HashMap:继承自AbstractMap类,实现了Map接口,允许键或值为空,线程不同步: Lin ...
- maven更新总结与tomcat发布方法总结
这些天来一直为不能直接把项目实时的发布到tomcat而费心思,项目使用了maven来组织,编译和运行,而maven插件的安装曾经有些问题,为此怀疑不能发布项目到tomcat是因为maven有问题,为些 ...
- C语言 结构体的内存对齐问题与位域
http://blog.csdn.net/xing_hao/article/details/6678048 一.内存对齐 许多计算机系统对基本类型数据在内存中存放的位置有限制,它们会要求这些数据的首地 ...