Converted to constructor selector function. Made 'each' function global
This commit is contained in:
parent
02947a1192
commit
167f5fafdf
50
README.md
50
README.md
@ -8,11 +8,25 @@ Browser support: IE8+, Latest versions of Firefox, Chrome, Safari, Opera
|
|||||||
|
|
||||||
## Basic Use: ##
|
## Basic Use: ##
|
||||||
|
|
||||||
* Selector: `var x = $(selector);`
|
* Function: `$_(selector).module.function(params);`
|
||||||
|
|
||||||
* Function: `$_.module.function(params);`
|
|
||||||
|
|
||||||
## Modules: ##
|
## Modules: ##
|
||||||
|
**Global**: Core functions
|
||||||
|
|
||||||
|
functions:
|
||||||
|
|
||||||
|
* $:
|
||||||
|
Use:
|
||||||
|
$(selector);
|
||||||
|
|
||||||
|
*each: For applying changes to every item matched by a selector
|
||||||
|
Use:
|
||||||
|
$_(selector).dom.each(callback);
|
||||||
|
|
||||||
|
Example : $_(".foo").dom.each(function(e){
|
||||||
|
$_(e).dom.text(value);
|
||||||
|
}):
|
||||||
|
|
||||||
|
|
||||||
**Ajax**: simple, jQuery-like ajax functions
|
**Ajax**: simple, jQuery-like ajax functions
|
||||||
|
|
||||||
@ -65,11 +79,11 @@ Browser support: IE8+, Latest versions of Firefox, Chrome, Safari, Opera
|
|||||||
|
|
||||||
*Add:
|
*Add:
|
||||||
Use:
|
Use:
|
||||||
$_.event.add(selector, event, callback);
|
$_(selector).event.add(event, callback);
|
||||||
|
|
||||||
*Remove
|
*Remove
|
||||||
Use:
|
Use:
|
||||||
$_.event.remove(selector, event, callback);
|
$_(selector).event.remove(event, callback);
|
||||||
|
|
||||||
**DOM**: Dom manipulation module
|
**DOM**: Dom manipulation module
|
||||||
|
|
||||||
@ -77,38 +91,30 @@ Browser support: IE8+, Latest versions of Firefox, Chrome, Safari, Opera
|
|||||||
|
|
||||||
*addClass:
|
*addClass:
|
||||||
Use:
|
Use:
|
||||||
$_.dom.addClass(selector, className);
|
$_(selector).dom.addClass(className);
|
||||||
|
|
||||||
*RemoveClass:
|
*RemoveClass:
|
||||||
Use:
|
Use:
|
||||||
$_.dom.removeClass(selector, className);
|
$_(selector).dom.removeClass(className);
|
||||||
|
|
||||||
*each: For applying changes to every item matched by a selector
|
|
||||||
Use:
|
|
||||||
$_.dom.each(selector, callback);
|
|
||||||
|
|
||||||
Example : $_.dom.each(".foo", function(e){
|
|
||||||
$_.dom.text(e, value);
|
|
||||||
}):
|
|
||||||
|
|
||||||
*show: For setting dom elements as visible. Type defaults as "block", can be set with optional second parameter.
|
*show: For setting dom elements as visible. Type defaults as "block", can be set with optional second parameter.
|
||||||
Use:
|
Use:
|
||||||
$_.dom.show(selector, [type]);
|
$_(selector).dom.show([type]);
|
||||||
|
|
||||||
*hide: Hides the elements matching the selector
|
*hide: Hides the elements matching the selector
|
||||||
Use:
|
Use:
|
||||||
$_.dom.hide(selector);
|
$_(selector).dom.hide();
|
||||||
|
|
||||||
*attr: Gets, sets, or removes an attribute from a selector.
|
*attr: Gets, sets, or removes an attribute from a selector.
|
||||||
Use:
|
Use:
|
||||||
Set: $_.dom.attr(selector, attributeName, attributeValue);
|
Set: $_(selector).dom.attr(attributeName, attributeValue);
|
||||||
Get: $_.dom.attr(selector, attributeName);
|
Get: $_(selector).dom.attr(attributeName);
|
||||||
Remove: $_.dom.attr(selector, attributeName, null);
|
Remove: $_(selector).dom.attr(attributeName, null);
|
||||||
|
|
||||||
*text: Gets or sets the text in between an element's tags
|
*text: Gets or sets the text in between an element's tags
|
||||||
Use:
|
Use:
|
||||||
Set: $_.dom.text(selector, text);
|
Set: $_(selector).dom.text(text);
|
||||||
Get: $_.dom.text(selector);
|
Get: $_(selector).dom.text();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user