во-первых, дайте отделению идентификатор. Затем вызовите функцию appendClass:
<script language="javascript">
function appendClass(elementId, classToAppend){
var oldClass = document.getElementById(elementId).getAttribute("class");
if (oldClass.indexOf(classToAdd) == -1)
{
document.getElementById(elementId).setAttribute("class", classToAppend);
}
}
</script>
Доступна веб-часть, которая делает это здесь . Вы также можете увидеть решение в сообществах TechNet от «potta vijay kumar» (где я тоже нашел эту веб-часть):
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('contentpage').contentWindow.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById('contentpage').height=
the_height;
}
contentpage
- это идентификатор iframe.
A Решение jQuery доступно в EndUserSharePoint.