An open API service indexing awesome lists of open source software.

https://github.com/morulus/jquery.tie

Additional functions for HTML build
https://github.com/morulus/jquery.tie

Last synced: about 1 year ago
JSON representation

Additional functions for HTML build

Awesome Lists containing this project

README

          

jquery.tie
==========

Additional functions for HTML build

# Usage
```javascript
// Adds a inside div (return this a)
$("div").put($('', {
"class": "newa"
}));

// Adds a after div (return this a)
$("div").and($('', {
"class": "newa"
}));

// Adds a before div (return this a)
$("div").before($('', {
"class": "newa"
}));

// Call anonym function in context of div (return this div)
$("div").tie(function() {
$(this).put($(''));
});

// Eval condition and call first function is true and second function if false (return functions result)
$("div").condition(a==b, function() {
return $(this).put($(''));
}, function() {
$(this).and($('

'));
return this;
});

```

# Benefits
Compact code and ease to creating sub-elements
```javscript
$('body')
.put($(''))
.tie(function() {
$(this).put($('

')).html('Hello, world')
.and($('')).html('It's my article'));
})
.and($(''))
.put($('')).html('Call me');
```

# Install
```bower
$ bower install jquery.tie
```