Connecting Tech Pros Worldwide Help | Site Map

adjusting the height and width of innerHTML

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 16th, 2007, 08:45 AM
newbie
Guest
 
Posts: n/a
Default adjusting the height and width of innerHTML

I am a newbie on javascript, and here is a question I'd like to ask.
Thanks in advance for the help. Here you can see my point: right now,
I can ask the div of 'list_comment' to be 250x200. But when
'comments_display.php' is larger than 250x200, I really want a
scrollable list_comment, so that I can scroll down the comment in the
innerHTML.

Thanks,

<script>
function TurnOnDiv(e, div_name) {
theObject = document.getElementById(div_name);
theObject.style.width = "250px";
theObject.style.height = "200px";
var posx, posy;
if (!e) var e = window.event;
if (e.pageX || e.pageY) {
posx = e.pageX - 250;
posy = e.pageY - 200;
}
else if (e.clientX || e.clientY) {
posx = e.clientX + document.body.scrollLeft +
document.documentElement.scrollLeft - 250;
posy = e.clientY + document.body.scrollTop +
document.documentElement.scrollTop - 200;
}

theObject.style.left = posx + "px";
theObject.style.top = posy + "px";
theObject.style.visibility = "visible";
}

function ProcessAjax(serverPage, objID) {
xmlhttp = GetXmlHttpObject();
var obj = document.getElementById(objID);
xmlhttp.open("GET", serverPage);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}


</script>

<div id="list_comment" style="visibility: hidden"</div>

<p style="font-size: 13px" <a href="javascript://"
onclick="TurnOnDiv(event, 'list_comment');
ProcessAjax('comments_display.php', 'list_comment')">Read Comments
Quote:
Quote:
Quote:
>>></a></p>

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.