Archive for category Fjern title

>Fjern titler fra listeview webpart

>Sådan fjerne man titlerne/overskrifterne fra webpart med lister:

Resultat:

Indsæt en “webparten Indholdsredigering” og indsæt følgende kode:

<script type=”text/javascript” language=”javascript”>
_spBodyOnLoadFunctionNames.push(“HideHeaders”);
function HideHeaders()
{
var elements = getElementsByClassName(document, “tr”, “ms-viewheadertr”);
for(var i=0;i<elements.length;i++)
{
elem = elements[i]; elem.style.display = “none”;
}
}
function getElementsByClassName(oElm, strTagName, strClassName)
{
var arrElements = (strTagName == “*” && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
strClassName = strClassName.replace(/\-/g, “\\-“);
var oRegExp = new RegExp(“(^\\s)” + strClassName + “(\\s$)&quot;);
var oElement;
for(var i=0; i<arrElements.length; i++)
{
oElement = arrElements[i];
if(oRegExp.test(oElement.className))
{
arrReturnElements.push(oElement);
}
}
return (arrReturnElements)
}
</script>

Leave a comment