I have a home page component that has a custom VF Page behind it. Want to change the height of the home page component dynamically as the content gets added like how recent Item component lengths changes dynamically. How can I do that in JavaScript or VF Page?
Code example: Home Page Component :
<style>#sidebarDiv .sidebarModule .sidebarModuleBody{ padding:0px;}</style><iframe style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; WIDTH: 200px; HEIGHT: 290px; BORDER-TOP: medium none; BORDER-RIGHT: medium none" src="/apex/todo"></iframe>
Component with custom VF page: todo list - add the list item in the list
<apex:page docType="html-5.0" sidebar="false" showHeader="false" standardStylesheets="false" >
<html>
<head>
<title>To doApp</title>
<style>
html {
font: small/1.4 "Lucida Grande", Tahoma, sans-serif;
}
div.enter_todo {
margin: 0;
padding:5px;
height:25px;
width:160px;
background: #eee;
border:1px solid #aaa;
}
div.todo_list {
margin: 10px 5px 10px 0px;
padding:2px;
}
div.todo_list > div.todo {
background: #eeeeff;
min-width:150px;
max-width:170px;
min-height:25px;
padding-top:2px;
margin-top:1px;
}
div.todo_list > div.todo > div {
float:left;
}
div.todo_list > div.todo > div.todo_description {
margin-left:0px;
}
div.todo_list > div.checked {
text-decoration: line-through;
background: #eee;
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
var j$ = jQuery.noConflict();
j$(document).ready( function() {
j$('#add_todo').click( function() {
var todoDescription = j$('#todo_description').val();
j$('.todo_list').prepend('<div class="todo">'
+ '<div>'
+ '<input type="checkbox" class="check_todo" name="check_todo"/>'
+ '</div>'
+ '<div class="todo_description">'
+ todoDescription
+ '</div>'
+ '</div>');
j$('#todo_form')[0].reset();
j$('.check_todo').unbind('click');
j$('.check_todo').click( function() {
var todo = $(this).parent().parent();
todo.toggleClass('checked');
});
return false;
});
});
</script>
</head>
<body>
<div class="enter_todo">
<form id="todo_form" action="/apex/todo" method="POST">
<input type="text" size="12" id="todo_description" name="todo_description"/>
<input type="submit" id="add_todo" value="Add"/>
</form>
</div>
<div class="todo_list">
</div>
</body>
</html>
</apex:page>