擷取MOSS頁面中控制項使用的樣式)

來源:互聯網
上載者:User

原文連結:http://www.cnblogs.com/Bear-Study-Hard/archive/2007/07/27/833653.html

在Windows SharePoint Services 3.0的SDK中關於描述CSS的部分有這麼一段代碼,可以擷取頁面中各個控制項使用的樣式,方便修改預設樣式,而不用在樣式列表中花很長時間去搜尋。

 

在需要擷取樣式的頁面添加一個內容編輯器Web組件


然後開啟內容編輯器設定中的源編輯器,輸入如下的代碼

<script language="jscript">

function ClassInfo()

{

    if (window.event.srcElement.className != null)

    {

        stsclass.innerText = window.event.srcElement.className;

    }

    else

    {

        stsclass.innerText = "";

    }

}

 

window.document.body.onmouseover = ClassInfo;</script>

 

<div style="border-style:solid;border-width:1px; width: 281px; height: 34px;

position: absolute; left: 286px; top: 41px; z-index:15; padding-left:4px;

padding-right:4px; padding-top:2px; padding-bottom:2px; background-color:#EEEEF4">

<p id="stsclasstitle"><font face="Tahoma" id="Font1">Classname: </font>

<font face="Tahoma"id="stsclass"> </font>

</p></div>

點擊確定後,當滑鼠移到頁面上某個控制項上的時候就會在頁面上顯示出該控制項使用的樣式名。

如果覺得位置不好可以修改style中position的值來已變更位元置。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.