1. 没有OOTB的方法对Callout进行修改,Callout可以使用在以下范围:
- Document Library
- Assert Library
- Images Library
- Pages Library
- Task Lists
不能用在以下范围:
- Custom Lists
- Announcements Lists
- Calendar List
- Discussions List
2. 如果要对系统默认的Callout进行修改,只需要找到Launch Element (Callout 弹出框出现的元素),然后使用 getFromLaunchPoint() 方法就可以获得Callout对象;
3. 在使用Callout时有一些要求,请参考此处;
简单例子:
<div id="calloutPanel" style="50px;"> <span id="ms-pageDescriptionImage"></span> </div> <script> SP.SOD.executeFunc("callout.js", "Callout", function () { var calloutPageElement = document.getElementById("calloutPanel"); var calloutOptionsA = new CalloutOptions(); calloutOptionsA.ID = "unique identifier"; calloutOptionsA.launchPoint = calloutPageElement; calloutOptionsA.title = "callout title"; calloutOptionsA.content="ddddd"; calloutOptionsA.beakOrientation="leftRight"; var calloutA = CalloutManager.createNew(calloutOptionsA); calloutA.set({openOptions:{event: "hover", showCloseButton: true}}); }); </script>
效果:
4.