Iutil defines these function getPos, getPosition, getSize, getClient,
getScroll, getMargins, getPadding, getBorder, getPointer. There names go a
long way to describe there function. Most if not all the function return
objects with dimensional info about the passed element node. I recently used
it to write a plugin to overlay an element or elements over another element.
the .each could be changed to .attr(), but anyway. Iutil primarily use would
be in locating an elements spacial relationship to others nodes.
jQuery.fn.overlay = function(selector, strict) {
strict = strict == undefined ? strict = true : strict;
elements = jQuery(selector);
if(strict && !elements.length > 0) {
throw "Element not found to overlay";
}
else if(elements.length < 1) {
return this;
}
var pos = jQuery.iUtil.getPos(this[0]);
elements.each( function(idx) {
sty = this.style;
sty.position = "absolute";
sty.top = pos.y + "px";
sty.left = pos.x + "px";
sty.width = (pos.w - 8) + "px";
sty.height = (pos.h - 8) + "px";
});
}
--
View this message in context:
http://www.nabble.com/iUtil-use-it-tf2362236.html#a6581857
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/