SharePoint 2013 모양 색상 [중복]
-
10-12-2019 - |
문제
저는 SharePoint 2013 호스팅 앱을 개발 중입니다.
내 앱에서 스타일 사이트의 색상을 사용하고 싶습니다.
JS를 사용하여 사이트에서 사용하는 스타일 정보를 어떻게 검색할 수 있나요?
고마워요, NK
해결책
호스트 웹의 색상을 사용하려면 일부 JavaScript를 사용하여 호스트 웹의 스타일 시트를 동적으로 로드해야 합니다.페이지에서 jQuery를 사용하는 경우 다음 JavaScript 블록을 사용하여 호스트 웹의 스타일 시트를 페이지에 삽입할 수 있습니다.
(function () {
// Retrieve the host web's URL from the query string
var scriptbase = $.queryString('SPHostUrl') + '/_layouts/15/';
// Create a <link> tag for the style sheet
var $doclink = $('link').attr('rel', 'stylesheet');
// The style sheet is loaded through an ASP.NET HTTP handler (defaultcss.ashx)
$doclink.attr('href', scriptbase + 'defaultcss.ashx');
// Add the style sheet link to the
$('head').append($doclink);
})();
그래도 문제가 해결되지 않으면 Microsoft의 기사를 확인해 보세요. 어떻게:SharePoint용 앱에서 SharePoint 웹 사이트의 스타일시트 사용 jQuery가 필요하지 않은 예를 들어보세요.
제휴하지 않습니다 sharepoint.stackexchange