我建設使用2010的Sharepoint網站,我已經創建了一個內容編輯器Web部件中的一個時髦的jQuery幻燈片播放(使用視圖的HTML代碼編輯選項)。很好用,除非我想編輯jQuery在編輯屏幕上運行的Web部件並導致各種破壞。如何防止jQuery的運行,而在編輯模式下爲SharePoint Web部件?
我的HTML基本上是這樣的:
<div class="slideshow">
<div class="slide">Slide 1</div>
<div class="slide">Slide 2</div>
</div>
我的jQuery是這樣的:
$('.slideshow').each(function(){
// Do the magic
});
是否有一個類或ID,我可以在SharePoint 2010 Web部件依靠在編輯我可以利用,以防止jQuery選擇器看到我的幻燈片?事情是這樣的:
$('div:not(.sharepoint-edit-block) .slideshow').each(function(){
// Do the magic
});
的'$( 「#MSOLayout_InDesignMode」)。VAL()// 「1」 或 「」'在SharePoint辦公室工作對我來說365聽起來很明顯,但檢查的字符串值 「1」,而不是1號。 – redfox05