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
相关文档:
JavaScript中的JSON
JavaScript是为网景浏览器做页面脚本语言而实现的一种编程语言。它现在还被很多人误解是java的子集。它是一种具有类C语法和弱对象的模式语言。JavaScript完全遵守ECMAScript语言说明书第三版。
JSON是JavaScript对象文字记号的子集。由于JSON是JavaSript的子集,所以在JavaScript里, ......
2、原型方式
/**
* Person类:定义一个人,有个属性name,和一个getName方法
*/
function Person(){}
Person.prototype.name = "jack";
Person.prototype.getName = function() { return this.name;}
把类的属性(字段),方法都挂在prototype上。
造几个对象测试下:
var p1 = new Person();
var ......
有些网友经常询问:在VC++中如何访问javascript中的对象、函数、变量等元素?
这里把以前发表的一系列文章集中在一起,方便查阅。
vc++访问javascript(1)--window在脚本引擎中的作用
http://blog.csdn.net/pimshell/archive/2008/08/02/2758863.aspx
vc++访问javascript(2)--IDispatchEx是动态脚本语言的基础&nb ......
去除字符串左右两端的空格,在vbscript里面可以轻松地使用 trim、ltrim 或 rtrim,但在js中却没有这3个内置方法,需要手工编写。下面的实现方法是用到了正则表达式,效率不错,并把这三个方法加入String对象的内置方法中去。
<input type="text" name="mytxt" value=" 12345678 &nbs ......
看到一篇入门的JS继承文章,转载下
原地址:http://sdcyst.javaeye.com/blog/288813
类变量/类方法/实例变量/实例方法
先补充一下以前写过的方法:
在javascript中,所有的方法都有一个call方法和apply方法.这两个方法可以模拟对象调用方法.它的第一个参数是对象,后面的
参数表示对象调用这个方法时的参数(ECMAScript spec ......