javascript table操作类
/************** javascript table操作类***************
* 仅适合IE6
****调用示例*****************************************
*
* var table=new TableOption("tb");
*
* var table=new TableOptions("tb",{hoverColor:#aabbcc,hover:false});
*
*****************************************************/
var $=function(id){return document.getElementById(id);}
var Class={
create:function(){
return function(){
this.Init.apply(this,arguments);
}
}
}
var BindAsEventListener=function(fun,object){
return function(){
return object.apply(fun,arguments);
}
}
var AddEventHandler=function(obj,eventType,fun){
obj.attachEvent("on"+eventType,fun);
}
var RemoveEventHandler=function(obj,eventType,fun){
obj.detachEvent("on"+eventType,fun);
}
var Extend=function(source,options){
for(var key in source)
{
options[key]=source[key];
}
}
var TableOption=Class.create();
TableOption.prototype={
//初始化
Init:function(obj,options){
this.Table=$(obj);
this.SetOptions(options);//设置参数
this.HoverColor=this.Options.hoverColor;
this.ActiveColor=this.Options.activeColor;
this.Hover=this.Options.hover;
this.Choose=this.Options.choose;
this.Multiple=this.Options.multiple;
this.OnClick=this.Options.onClick;
this.OnCancel=this.Options.onCancel;
this._AddMouseEvent(); //添加事件
this._CurrentRow=null; //当前移动行
this.SelectedArray=new Array();//设置或返回被选中行的集合
},
//设置参数
SetOptions:function(options){
this.Options={
hoverColor:"#B5FFB5", //移动时背景色
activeColor:"#438ADA", //选中时背景色
hover:true, //是否开启移动行背景色
choose:true, //是否开启选择
multiple:true, //是否开启多选,开启后按Ctrl可以多选
相关文档:
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......
用call方法实现继承
function classA(sColor){
this.color=sColor;
this.sayColor=function(){
alert(this.color);
......
<!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-eq ......
问:
1.如何在JavaScript访问C#函数?
2.如何在JavaScript访问C#变量?
3.如何在C#中访问JavaScript的已有变量?
4.如何在C#中访问JavaScript函数?
问题1答案如下:
javaScript函数中执行C#代码中的函数:
方法一:1、首先建立一个按钮,在后台将调用或处理的内容写入button_click中;
&n ......
利用 Page.RegisterStartupScript("", "<script language='javascript'> results();</script>");
或者是 Page.RegisterClient ......