javascript高级程序设计,高手来看看。。。[ 本帖最后由 xjl756425616 于 2011-03-24 21:22:55 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $("msg").css({background:"green",border:"1px solid red"});//文件中输入这句话。。function $(id){ var $e = document.getElementById(id); _JQUERY.call($e); return $e;} ;_JQUERY=function() { //这个obj不知怎么改??? this.css = function(array) { var s = []; for(var key in array) { s.push(key+":"+array[key]); } s=s.join(); s=s.replace(/,/g,";"); this.style.cssText = s; //document.getElementById("msg").style.cssText=s; //这边可能也要替换掉 }}话说这仅仅是一个模拟,不要以为jquery就是这么做的 用对象直接给style赋值也许会更好些!这个用法不是JQ的,但是接近prototype框架的写法!<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <script type="text/javascript"> function Jquery(id){ this.dom=document.getElementById(id); } function $(id){ return new Jquery(id); } Jquery.prototype={ css:function(array) { for(var key in array) { this.dom.style[key]=array[key]; } } } </script> </HEAD> <BODY> <div id="msg"></div> <script type="text/javascript"> $("msg").css({background:"green",border:"1px solid red",width:"100px",height:"100px"}); </script> </BODY></HTML> www.flvxz.com 和 www.flvcd.com 是基于什么原理开发的? 请教一个小问题~ 关于jpgraph在Linux下配置问题 JSON 404错误之后转到指定的页面 急 PHP中文件上传时的判断用户是否选择文件的问题 请问:在PHP中调用Javascript的问题:好象echo解决不了:( 关于web邮件系统的问题,大家帮忙看看 谁有好使的SMTP地址给我一个。我想试一下mail() 本人拥有一个价值十万的域名,谁有兴趣合作? 关于php中类的应用,新手问题,请各位帮忙 PHP经典好书
var $e = document.getElementById(id);
_JQUERY.call($e);
return $e;
} ;
_JQUERY=function() { //这个obj不知怎么改???
this.css = function(array)
{
var s = [];
for(var key in array)
{
s.push(key+":"+array[key]);
}
s=s.join();
s=s.replace(/,/g,";");
this.style.cssText = s;
//document.getElementById("msg").style.cssText=s; //这边可能也要替换掉
}
}话说这仅仅是一个模拟,不要以为jquery就是这么做的
用对象直接给style赋值也许会更好些!这个用法不是JQ的,但是接近prototype框架的写法!<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript">
function Jquery(id){
this.dom=document.getElementById(id);
}
function $(id){
return new Jquery(id);
}
Jquery.prototype={
css:function(array)
{
for(var key in array)
{
this.dom.style[key]=array[key];
}
}
}
</script>
</HEAD> <BODY>
<div id="msg"></div>
<script type="text/javascript">
$("msg").css({background:"green",border:"1px solid red",width:"100px",height:"100px"});
</script>
</BODY>
</HTML>