javascript实现聊天窗口滚动条总在最下面的方法
<html>
<head>
<title>javascript实现聊天窗口滚动条总在最下面的方法</title>
<script language="javascript">
function addMessage(message){
var chatArea=document.getElementById("chatArea");
chatArea.innerHTML += message+ '<br />';
chatArea.scrollTop = chatArea.scrollHeight;
}
function sendMessage(){
var msg=document.getElementById("msg").value;
addMessage(msg);
}
</script>
</head>
<body>
<div id="chatArea" style="overflow:auto; height: 120px; width: 450px; border: 1px solid #666;"></div>
<input type="text" name="msg" id="msg"/><input type="button" value="发送消息" onclick="sendMessage();
"/>
</body>
</html>
相关文档:
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>横向不间断滚动图片</title>
<meta http- ......
问:
1.如何在JavaScript访问C#函数?
2.如何在JavaScript访问C#变量?
3.如何在C#中访问JavaScript的已有变量?
4.如何在C#中访问JavaScript函数?
问题1答案如下:
javaScript函数中执行C#代码中的函数:
方法一:1、首先建立一个按钮,在后台将调用或处理的内容写入button_click中;
&n ......
keycode 8 = BackSpace BackSpace
keycode 9 = Tab Tab
keycode 12 = Clear
keycode 13 = Enter
keycode 16 = Shift_L
keycode 17 = Control_L
keycode 18 = Alt_L
keycode 19 = Pause
keycode 20 = Caps_Lock
keycode 27 = Escape Escape
keycode 32 = space space
keycode 33 = Prior
keycode 34 ......