javascript 浮动窗口滚动.拖动
<script type="text/javascript">
function close(){
QQkefu.style.display="none";
return true;
}
function msgBox()
{
this.container = "aaaa";
this.titleheadArea = "titlehead";
this.width = 154;
this.height = 105;
this.smallHeight = 20;
this.smallId = "small";
this.area = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
this.space = 5;
this.timer;
this.timeOut = 150;
this.smalled = false;
window.msgBoxListener = this;
this.$(this.smallId).onclick= function(){msgBoxListener.toSmall()};
}
msgBox.prototype.flow = function()
{
this.$(this.container).style.position = "absolute";
this.$(this.container).style.zIndex = "1000";
if(this.smalled)
{
this.$(this.container).style.top = this.area.scrollTop + this.area.clientHeight - this.smallHeight - this.space + "px";
}else{
this.$(this.container).style.top = this.area.scrollTop + this.area.clientHeight - this.height - this.space + "px";
}
this.$(this.container).style.left = this.area.scrollLeft + this.area.clientWidth - this.width - this.space + "px";
}
msgBox.prototype.toSmall = function()
{
if(this.smalled)
{
this.$(this.container).style.marginTop = -this.height + "px";
this.$(this.container).style.height = this.height + "px";
this.smalled = false;
this.flow();
this.$(this.container).style.marginTop = "0px";
}else{
th
相关文档:
有些网友经常询问:在VC++中如何访问javascript中的对象、函数、变量等元素?
这里把以前发表的一系列文章集中在一起,方便查阅。
vc++访问javascript(1)--window在脚本引擎中的作用
http://blog.csdn.net/pimshell/archive/2008/08/02/2758863.aspx
vc++访问javascript(2)--IDispatchEx是动态脚本语言的基础&nb ......
很经典的一个算法,学习…ing… :
<!-- 中国农历开始 -->
<SCRIPT language=JavaScript>
<!--
var lunarInfo=new Array(
0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,
0x04ae0,0x0a5b6,0x0a4d0,0x0d25 ......
function
getVerificationCode()//取得验证码
{
var
para =
new
Array(
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
&nbs ......
在Web上显示图片,通常都会有图片显示比例问题,如果不给<img />限制width和height,那么如果图片大了就会将整个页面挤乱,图片小了又会使图片失真。
我的需求如下:
1、预先定义好图片显示的标准宽度和高度。
&nb ......
看到一篇入门的JS继承文章,转载下
原地址:http://sdcyst.javaeye.com/blog/288813
类变量/类方法/实例变量/实例方法
先补充一下以前写过的方法:
在javascript中,所有的方法都有一个call方法和apply方法.这两个方法可以模拟对象调用方法.它的第一个参数是对象,后面的
参数表示对象调用这个方法时的参数(ECMAScript spec ......