728x90
[출처] http://paulbuzzblog.wordpress.com/2012/11/23/how-to-hide-the-sharepoint-ribbon/
function hideEditRibbon() {
var ribbon = SP.Ribbon.PageManager.get_instance().get_ribbon();
// Set the tab to the “Browse” tab
SelectRibbonTab("Ribbon.Read", true);
// Remove the “Edit” tab from a list from from the ribbon.
ribbon.removeChild('Ribbon.ListForm.Edit');
}
SP.SOD.executeOrDelayUntilScriptLoaded(function() {
var pm = SP.Ribbon.PageManager.get_instance();
pm.add_ribbonInited(function() {
hideEditRibbon();
});
var ribbon = null;
try {
ribbon = pm.get_ribbon();
}
catch (e) { }
if (!ribbon) {
if (typeof(_ribbonStartInit) == "function")
_ribbonStartInit(_ribbon.initialTabId, false, null);
}
else {
hideEditRibbon();
}
},
"sp.ribbon.js");
728x90
'script' 카테고리의 다른 글
pc 표준시간대 변경에 따른 javascript 현재시간 조정 (0) | 2014.04.08 |
---|---|
javascript 동적 css 파일 반영 (0) | 2014.03.11 |
javascript 에서 동적으로 css 속성 주기 (0) | 2014.01.10 |
a 태그에 동적 target 지정하기 (0) | 2014.01.07 |
load the external JavaScript dynamically (0) | 2013.09.25 |
댓글