尝试在SharePoint Online中包装升级的互动程序时未保存代码

尝试在SharePoint Online中包装升级的互动程序时未保存代码,sharepoint,sharepoint-online,Sharepoint,Sharepoint Online,对于另一个关于这个的问题,我深表歉意,但我已经尽了很大的努力来实现这个目标(我对SharePoint相当陌生,不具备丰富的编码知识,但了解HTML,而且通常在解决问题方面还不错) 我们正在使用SharePoint online,我们有SharePoint互动程序。我们最近又添加了几个互动程序,显然没有包装这些互动程序,因此必须向右滚动才能访问一些互动程序 我已经找到了包装瓷砖的代码,当编辑页面源代码时,它似乎正在工作。。。直到我保存它。当我下一次转到内容编辑器时,我输入的代码将被删除 我读过几页

对于另一个关于这个的问题,我深表歉意,但我已经尽了很大的努力来实现这个目标(我对SharePoint相当陌生,不具备丰富的编码知识,但了解HTML,而且通常在解决问题方面还不错)

我们正在使用SharePoint online,我们有SharePoint互动程序。我们最近又添加了几个互动程序,显然没有包装这些互动程序,因此必须向右滚动才能访问一些互动程序

我已经找到了包装瓷砖的代码,当编辑页面源代码时,它似乎正在工作。。。直到我保存它。当我下一次转到内容编辑器时,我输入的代码将被删除

我读过几页关于它的文章,并尝试过内容编辑器web部件之类的东西,但我一生都无法让它工作

如果有人知道是否有一个分步指南,以确保包装瓷砖保存,我可能能够让它工作

非常感谢您的帮助


如果有任何变化,我们将使用作为Office 365帐户一部分的SharePoint online。

将以下代码添加到页面中的脚本编辑器web部件中

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {  
    // Update this value to the number of links you want to show per row
    var numberOfLinksPerRow = 6;

    // local variables
    var pre = "<tr><td><div class='ms-promlink-body' id='promlink_row_";
    var post = "'></div></td></tr>";
    var numberOfLinksInCurrentRow = numberOfLinksPerRow;
    var currentRow = 1
    // find the number of promoted links we're displaying
    var numberOfPromotedLinks = $('.ms-promlink-body > .ms-tileview-tile-root').length;
    // if we have more links then we want in a row, let's continue
    if (numberOfPromotedLinks > numberOfLinksPerRow) {
        // we don't need the header anymore, no cycling through links
        $('.ms-promlink-root > .ms-promlink-header').empty();
        // let's iterate through all the links after the maximum displayed link
        for (i = numberOfLinksPerRow + 1; i <= numberOfPromotedLinks; i++) {
            // if we're reached the maximum number of links to show per row, add a new row
            // this happens the first time, with the values set initially
            if (numberOfLinksInCurrentRow == numberOfLinksPerRow) {
                // i just want the 2nd row to
                currentRow++;
                // create a new row of links
                $('.ms-promlink-root > table > tbody:last').append(pre + currentRow + post);
                // reset the number of links for the current row
                numberOfLinksInCurrentRow = 0;   
            }    
            // move the Nth (numberOfLinksPerRow + 1) div to the current table row    
            $('#promlink_row_' + currentRow).append($('.ms-promlink-body > .ms-tileview-tile-root:eq(' + (numberOfLinksPerRow) + ')'));    
            // increment the number of links in the current row
            numberOfLinksInCurrentRow++;  
        }
    }
});
</script>

$(文档).ready(函数(){
//将此值更新为每行要显示的链接数
var numberOfLinksPerRow=6;
//局部变量
var pre=“”;
var numberOfLinksInCurrentRow=NumberOfLinksError;
var currentRow=1
//查找我们正在显示的已升级链接的数量
var numberOfPromotedLinks=$('.ms promlink body>.ms tileview tile root')。长度;
//如果我们有更多的链接,然后我们希望在一行,让我们继续
如果(numberOfPromotedLinks>NumberOfLinksError){
//我们不需要标题了,没有循环通过链接
$('.ms promlink root>.ms promlink header').empty();
//让我们在显示的最大链接之后遍历所有链接
对于(i=numberOfLinksPerRow+1;i table>tbody:last')。追加(pre+currentRow+post);
//重置当前行的链接数
numberOfLinksInCurrentRow=0;
}    
//将第n个(NumberOfLinksError+1)div移动到当前表行
$('#promlink_row.'+currentRow).append($('.ms-promlink body>.ms-tileview磁贴根:eq(+(numberOfLinksPerRow)+'));
//增加当前行中的链接数
numberOfLinksInCurrentRow++;
}
}
});
我们还可以在页面的脚本编辑器web部件中使用下面的CSS样式来实现它

<style>
.ms-promlink-body {
    width: 960px;
}      
</style>

promlink女士{
宽度:960px;
}      

非常感谢您。最后,这项工作终于开始了(注:很抱歉反应太晚,我正在放圣诞假)。