Is it possible to do things like

var storage_for_future;

$.DIV({'class':'big'},
storage_for_future = $.SPAN({id:'one','class':'ps'},'Hello Joe',$.I ({},'!'))
);

and thus "inline" save references for DOM elements you create?

Andreas

On Feb 17, 2007, at 11:42, Francesco Sullo wrote:

Hi all,

I want to announce a new plugin for jQuery. I hope you like it.
Cheers,
Francesco

***

jQuick Tag Creator for jQuery
http://jquick.sullof.com


How it works

Suppose you want to obtain the following html code:
<div class="big">
    <span id="one" class="ps">Hello Joe<i>!</i></span>
</div>
Using jQuick you could create the corresponding DOM elements with the following code:
$.DIV({'class':'big'},
    $.SPAN({id:'one','class':'ps'},'Hello Joe',$.I({},'!'))
);
Now suppose that you want to animate the SPAN element. You could write:
$("#cico").append(
    $.DIV({'class':'big'},
        $.SPAN({id:'one','class':'ps'},
            'Hello Joe',$.I({},'!')
        ).animate({left: 50, opacity: 'show'}, 1000)
    )
);

Note

With jQuery 1.1.1, if you want to preserve spaces, you could apply a little fix to the jQuery clean method changing the line 449 from:
var s = jQuery.trim(arg), ...
to:
var s = /^\s+</.test(arg) ? jQuery.trim(arg) : arg, ...
so that only the tags are trimmed.

jQuick supports all XHTML Strict and Frameset DTD tags but you can add what you want.
jQuick was inspired by DOM Creation by Michael Geary (http://mg.to).

Enjoy it!


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to