문제

SharePoint2013 App (SharePoint Hosted)을 배포하고 있습니다.JavaScript / CSS에서 SharePoint2013 탑 바 (사이트 이름, 뉴스 피드, OneDrive 사이트)를 어떻게 제거 할 수 있습니까?나는 tha 페이지를 인쇄해야합니다.

감사합니다, nk

도움이 되었습니까?

해결책

To hide it during Print, you can use the following CSS:

@media print
{    
    div#suiteBar {
        display: none;
    }
}

다른 팁

Or you can print only needed element by using this JavaScript code:

<script type="text/javascript"> 
       function printPartOfPage(elementId) { 
        var printContent = document.getElementById(elementId); 
        var windowUrl = ''; 
        var uniqueName = new Date(); 
        var windowName = 'Print' ; 
        var printWindow = window.open(windowUrl, windowName, 'left=-20,top=-20,width=0,height=0'); 
        printWindow.document.write('<HTML><Head><Title></Title>'); 
        printWindow.document.write('</Head><Body style="margin-left:50px;margin-top:50px;font-size:10pt;">'); 
        printWindow.document.write(printContent.innerHTML); 
        printWindow.document.write('</Body></HTML>'); 
        printWindow.document.close(); 
        printWindow.focus(); 
        printWindow.print(); 
        printWindow.close(); 
    } 

</script>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top