Skip to content

A New js Framework adapted from jquery(js框架,仿jq设计思想,根据自己想法写的新方法)

Notifications You must be signed in to change notification settings

songhailong123/newquery.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

无new引用

  • $(selector),支持css3属性以及各种选择器,例如$("div")

css方法

  • $(obj).css(str);str="width:100px;height:100px;background:red"

extend

  • 为newquery原型添加对象/方法,$.fn.extend(name,obj);

animate

  • 动画函数,animate(json,time,fn);例如
$("div").css("width:100px;height:100px;background:red;position:absolute").animate({"left":500},20,function(){
	this.animate({"color":"yellow"})
})

注意:写入回调函数时,需要传入this.animate才可以,json为目标值,time为执行时间,默认为1s,fn为回调函数

appendDom

  • 添加一个节点,参数{type:"",attr={key1:"value"},data}data为字符串可选 示例:
$("p").appendDom({
	type:"a",
	attr:{
		href:"2.html",
		target:"_blank"
	},
	data:"helloworld"
});

appendSameList

  • 添加一个相同节点的列表,参数值num,obj={type,attr:{key:"value"},data可选 示例:
		$("p").appendSameList(5,{
			type:"a",
			attr:{
				href:"2.html",
				target:"_blank"
			},
			data:"helloworld"
		})

appendDiffList

  • 添加不同节点类型的列表(但也可以相同),参数{type:[],attr:[{key:"value"}],data:[]} 示例:
$("p").appendDiffList({
	type:["div","a"],
	attr:[{class:"hello",nihao:"hy"},{href:"index.html"}],
	data:["hello","world"]
})

About

A New js Framework adapted from jquery(js框架,仿jq设计思想,根据自己想法写的新方法)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published