
May 4th, 2005, 02:01 PM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 3
Time spent in forums: 29 m 19 sec
Reputation Power: 0
|
|
|
function help
So I have this function but for some reason it doesn't work. It seems like it should but it keeps giving me an error every time 'onclick' can someone help me with this? I really dont see anything wrong.
Code:
<script language="javascript">
function resizeMe(action)
{
// By how much to resize it
resize_by = 50;
// Take the current_width and height and create integers from them for further "playing"
current_height = document.getElementById('message_inbox').style.hei ght;
current_height = parseInt( current_height.substr(0, -2) );
// What to do
if ( action == 1 )
{//Enlarge
current_height += resize_by ;
}
else if ( action == 0 )
{//Shrink
current_height -= resize_by ;
}
// Apply the new dimensions to the element
document.getElementById('message_inbox').style.hei ght = current_height + "px";
}
</script>
Code:
<table width='100%'>
<tr>
<td><iframe marginwidth="0" align="left" height="200px" width="100%" id='message_inbox' src="message.php?action=email_box" scrolling="yes" align=left frameborder=0 hspace=0 vspace=0> </iframe></td>
</tr>
<tr>
<td><a href="javascript:resizeMe(1)">Increase</a></td>
</tr>
<tr>
<td><a href="javascript:resizeMe(0)">Decrease</a></td>
</tr>
</table>
|