/*
- * jQuery (http://jquery.com/)
+ * JQuery (http://jquery.com/)
* By John Resig (http://ejohn.org/)
* Under an Attribution, Share Alike License
*
},
css: function(a,b) {
- return this.each(function(){
- if ( !b )
- for ( var j in a )
- $.attr(this.style,j,a[j]);
- else
- $.attr(this.style,a,b);
- });
+ return a.constructor != String || b ?
+ this.each(function(){
+ if ( !b )
+ for ( var j in a )
+ $.attr(this.style,j,a[j]);
+ else
+ $.attr(this.style,a,b);
+ }) : $.css( this.get(0), a );
},
toggle: function() {
return this.each(function(){
var clone = this.size() > 1;
var a = $.clean(arguments);
return this.each(function(){
- for ( var i in a )
+ for ( var i = 0; i < a.length; i++ )
this.appendChild( clone ? a[i].cloneNode(true) : a[i] );
});
},
var clone = this.size() > 1;
var a = $.clean(arguments);
return this.each(function(){
- for ( var i in a )
+ for ( var i = 0; i < a.length; i++ )
this.parentNode.insertBefore( clone ? a[i].cloneNode(true) : a[i], this );
});
},
checked: "a.checked"
},
// TODO: Write getAttribute helper
- ".": "$.hasWord(a.className||a.getAttribute('class'),m[2])",
+ ".": "$.hasWord(a,m[2])",
"@": {
"=": "$.attr(a,m[3]) == m[4]",
"!=": "$.attr(a,m[3]) != m[4]",
}
};
-function triggerEvent(element,type) {
- if ( element["on" + type] )
- element["on" + type]({ type: type });
+function triggerEvent(element,type,data) {
+ data = data || [{ type: type }];
+ if ( element && element["on" + type] )
+ $.apply( element, element["on" + type], data );
}
function handleEvent(event) {
setTimeout(function(){
if ( typeof Prototype != "undefined" && $.g == null && $.clean == null )
throw "Error: You are overwriting jQuery, please include jQuery last.";
-}, 1000);
+}, 1000);
\ No newline at end of file