当前位置: 首页 > 图文教程 > 网络编程 > Javascript > JObj预览一个JS的框架

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 JObj预览一个JS的框架


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 162 ::
收藏到网摘: n/a

我说过,我要写一个JS的框架,我知道有人会从心底BS我,但是:你继续BS吧!我还是要写我的JOBJ。 我的时间不多,大部分是在工作之余写的。
复制代码 代码如下:

JObj.Dom.$tag("INPUT")
.$filter(function(o){
var fa = o.parentNode.parentNode.parentNode;
return f =(o.type == "text" && fa.id == "hollerNew") ? true : false;
})
.$css({width:"570px",height:"18px",lineHeight:"18px"})
.$attr({className:"hollerFormNormal"})
.$event({
onfocus:"vControl('TEXTFOCUS',this)",
onblur:"vControl('TEXTBLUR',this)"
})
.$tag("TEXTAREA")
.$css({width:"570px",height:"100px",lineHeight:"18px"})
.$attr({className:"hollerFormNormal"})
.$event({
onfocus:"vControl('TEXTFOCUS',this)",
onblur:"vControl('TEXTBLUR',this)"
})
.$(document.hollerNew)
.$event({
onsubmit:function(){
return JObj.FormValidate.$validate(this,rules);
}
});
JObj.Dom.$(window)
.$event({
onscroll:"vControl('FIXTOOLBAR')"
});
var vControl = function(pChoice){
var args = arguments;
switch(pChoice){
case "BACKER":
var backer = args[1];
var id = args[2];
break;
case "FLOWERS":
var id = args[1];
break;
case "EGGS":
var id = args[1];
break;
case "TEXTFOCUS":
args[1].className = "hollerFormFocus";
break;
case "TEXTBLUR":
args[1].className = "hollerFormNormal";
break;
case "SHOWTIP":
var o,t;
switch(args[3]){
case "FLOWER":
o = "hollerTip_flower_";
t = "鲜花 " + args[2] + " 朵,送他/她一朵,让她开花店!"
break;
case "EGG":
o = "hollerTip_egg_";
t = "鸡蛋 " + args[2] + " 枚,如果你怕不够孵小鸡,你在给他/她一枚!"
break;
default :
return;
}
JObj.Dom.$(o + args[1])
.$attr({innerHTML:t})
.$css({display:"",position:"relative"})
.$show("fast",
{width:0,height:0},
{width:400,height:18}
);
break;
case "HIDETIP":
var o;
switch(args[2]){
case "FLOWER": o = "hollerTip_flower_";break;
case "EGG": o = "hollerTip_egg_";break;
default : return;
}
JObj.Dom.$(o + args[1])
.$hide("fast");
break;
case "FIXTOOLBAR":
JObj.Dom.$("toolBar")
.$css({opacity:0.1,filter:"Alpha(Opacity=10)"})
.$moveToScrollTop("fast");
break;
}
}