This is the reference for the object-oriented interface, which is built on top of the functional API. Typically, each method wraps a single API function, though some (e.g. anchors) wrap multiple functions. The relationships between the two interfaces are cross-referenced for convenient comparison.
Note this document is a work in progress. We ask that you please bear with us.
The C function constructs an object that abstracts a
form control. This constructor inherits from E.
Note to always use with the new
operator if calling the constructor from an alternate frame.
Creating C objects from form controls in alternate frames
does not require the new operator.
c = C([el]); c = new C([el]);
var c = C('myid');
var c = C(F('myform').controls('myinput'));
window.alert('Value is ' + c.getValue());
b = c.changed();
b = C('mycontrol').changed();
The method returns a boolean.
value = c.getValue([default]);
value = C('myid').getValue();
defaultValue = C('myid').getValue(true);
The method returns a string or array.
The D function constructs an object that abstracts a
document.
Note to always use with the new
operator if calling the constructor from an alternate frame.
Creating D objects from documents in alternate frames does
not require the new operator.
d = D([doc]); d = new D([doc]);
var d = D();
window.alert(d.isXHTML());
d = D(doc);
d.onReady(function() { window.alert('Ready'); });
d.on('click', function() { this.setScrollPosition(100, 0); });
var q = d.query('.testclass');
d.addStyleRule(selector, rule[, media])
D().addStyleRule('.myclass', 'color:#ff0000');
D(doc).addStyleRule('.myclass', 'color:#ff0000');
D().addStyleRule('fieldset', 'display:none', 'print');
The method returns the D object.
a = d.anchors([i]);
anchors = D().anchors();
anchors = D(doc).anchors();
anchor = D().anchors(0);
anchor = D().anchors('myname');
The method returns an array (or array-like host object) or a element.
Note array-like host objects are live collections, so handle with results with care. Use the toArray function to convert to an array.
el = d.body();
el = D().body(); el = D(doc).body();
The method returns a body element.
c = d.children([i]);
children = D().children(); children = D(doc).children(); child = D().children(0);
Normally, the method returns an array or an element; but, if the index (i) is out of bounds, it will return undefined.
r = d.clientRectangle();
r = D().clientRectangle(); r = D(doc).clientRectangle();
The method returns an array containing the top, left, height and width of the viewport.
el = D().create(tag);
el = D().create('div');
el = D(doc).createElement('div');
The method returns an element.
el = D().createWithAttributes(tag, atts);
el = D().createWithAttributes('div', { id:'me', 'class':'hello' });
el = D(doc).createWithAttributes('div', { id:'you', 'class':'hello' });
The method returns an element.
el = D(el).createWithProperties(tag, props);
el = D().createElementWithProperties('input', { type:'checkbox', checked:true });
el = D(doc).createElementWithProperties('input', { type:'checkbox', checked:true });
The method returns an element.
d.deleteCookie(name[, path]);
D().deleteCookie('test');
D(doc).deleteCookie('test');
The method returns the D object.
e = d.descendants(tag[, i]);
els = D().descendants('*');
els = D(doc).descendants('*');
el = D().descendants('div', 0);
Normally, the method returns an array (or array-like host object) or element; but, if the index (i) is out of bounds, it will return undefined.
Note array-like host objects are live collections, so handle with results with care. Use the toArray function to convert to an array.
e = d.forms([i]);
els = D().forms();
els = D(doc).forms();
el = D().forms(0);
el = D().forms('myname');
The method returns an array (or array-like host object) or a form element.
Note array-like host objects are live collections, so handle with results with care. Use the toArray function to convert to an array.
s = d.getCookie(name[, defaultValue[, encoded]]);
c = D().getCookie('test');
c = D(doc).getCookie('test');
c = D().getCookie('test', '');
The method returns a string or null.
p = d.getScrollPosition();
p = D().getScrollPosition(); p = D(doc).getScrollPosition();
The method returns an array containing the top and left scroll positions or null if the position cannot be determined.
el = d.head();
el = D().head(); el = D(doc).head();
The method returns a head element.
s = d.html([xhtml]);
html = D().html(); html = D(doc).html(); xhtml = D(doc).html(true);
The method returns a string.
el = d.htmlElement();
el = D().htmlElement(); el = D(doc).htmlElement();
The method returns an html element.
e = d.images([i]);
els = D().images();
els = D(doc).images();
el = D().images(0);
el = D().images('myname');
The method returns an array (or array-like host object) or img element.
Note array-like host objects are live collections, so handle with results with care. Use the toArray function to convert to an array.
b = d.isXhtml();
b = D().isXhtml(); b = D(doc).isXhtml();
The method returns a boolean value.
e = d.links([i]);
els = D().links();
els = D(doc).links();
el = D().links(0);
el = D().links('myname');
The method returns an array (or array-like host object) or a element.
Note array-like host objects are live collections, so handle with results with care. Use the toArray function to convert to an array.
d.load(doc);
D().load(doc);
The method returns the D object.
doc = d.node();
doc = D().node();
The method returns a document.
d.off(ev, fn);
D().off('click', fn);
D(doc).off('click', fn);
The method returns the D object
d.on(ev, fn[, context]);
D().on('click', function() { window.alert('Hello again!'); });
D().on('click', function() { this.doSomething(); }, someObject);
D(doc).on('click', function() { this.doSomethingElse(); }, someObject);
The method returns the D object
d.onReady(fn);
D(doc).onReady(function() { doSomething(); });
D(docOther).onReady(function() { doSomethingElse(); });
The method returns the D object
q = d.query(selector);
q = D().query('div');
q = D(doc).query('div');
q = D().query('div div div');
q = D().query('.myclass');
q = D().query('#myid');
q = D().query('#myid p.myclass');
q = D().query('div:first-child');
q = D().query('div:only-child');
q = D().query('div:nth-child(5)');
q = D().query('h2 + div');
q = D().query('h2 + div#myid');
q = D().query('h2 ~ div#myid');
The method returns a Q object.
r = d.scrollRectangle();
r = D().scrollRectangle(); r = D(doc).scrollRectangle();
The function returns an array containing the top, left, height and width of the top-level rendered element (HTML or body).
r = d.scrollSize();
r = D().scrollRectangle(); r = D(doc).scrollRectangle();
The function returns an array containing the height and width of the top-level rendered element (HTML or body).
d.setActiveStyleSheet(id);
D().setActiveStyleSheet('winter');
D(doc).setActiveStyleSheet('winter');
D().setActiveStyleSheet('summer');
The method returns the D object
d.setCookie(name, value[, expires[, path[, secure]]]);
D().setCookie('myname', 'myvalue');
D(doc).setCookie('myname', 'myvalue');
D().setCookie('myname', 'myvalue', 7); // Expires in 7 days
The method returns the D object
d.setScrollPosition(top, left[, isNormalized[, options[, callback]]]);
D().setScrollPosition(el, 0, 0); D(doc).setScrollPosition(el, 0, 0);
The method returns the D object
win = d.window();
win = D().window(); win = D(doc).window();
The method returns a window object.
The E function constructs an object that abstracts
an element.
Note to always use with the new
operator if calling the constructor from an alternate frame.
Creating E objects from elements in alternate frames does
not require the new operator.
e = E(id); e = new E(id);
var e = E(API.getHtmlElement());
e.onHelp(function() { window.alert('Help') }).onContextClick(function() { window.alert('Context click') });
e.load('testid');
e.fadeIn({ duration:1000 }).on('click', function() { window.alert('Clicked'); });
E().loadHtml('<div><strong>This is a test<\/strong><\/div>').appendTo(document.body);
e.absolute();
E('myid').absolute();
E(el).absolute();
The method returns the E object.
e.addClass(className);
E('myid').addClass('myclass');
E(el).addClass('myclass');
The method returns the E object.
e.addHtml(html);
E('myid').addHtml('<p>This is a test</p>');
E(el).addHtml('<p>This is also a test</p>');
The method returns the E object.
e.addText(text);
E('myid').addText('Burma-Shave');
E(el).addText('Burma-Shave');
The method returns the E object.
e.adjacent(el[, side]);
E('myid').adjacent(el);
E(el).adjacent(el2);
E('myid').adjacent(el, 'right');
E('myid').adjacent(el, 'top');
The method returns the E object.
e.appendTo(el);
E('myid').appendTo(el);
E(el).appendTo(elContainer);
The method returns the E object.
e.attachDrag([elHandle[, options]]);
E('myid').attachDrag();
E(el).attachDrag();
E(el).attachDrag(elHandle, { ondrop: function() { window.alert('Dropped!' } });
The method returns the E object.
w = e.border(side);
i = E('myid').border('right');
i = E(el).border('right');
i = E('myid').border('top');
The method returns a number of pixels.
o = e.borders();
o = E('myid').borders();
o = E(el).borders();
The method returns an object with properties named for each side (top, left, bottom and right), containing a number of pixels.
e.center([options[, callback]]);
E(el).center();
E('myid').center();
E(el).center({ duration:1000, ease:API.ease.circle });
E(el).center({ duration:1000, ease:API.ease.circle }, fn);
The method returns the E object.
c = e.children([i]);
c = E(el).children();
c = E('myid').children();
el = E(el).children(0);
Normally, the method returns an array or an element; but, if the index (i) is out of bounds, it will return undefined.
el = e.clone([deep]);
el = E(el).clone();
el = E('myid').clone();
el = E(el).clone(true);
The method returns an element.
b = e.containedBy(el);
b = E(el).containedBy(elContainer);
b = E('myid').containedBy(elContainer);
The method returns a boolean.
e.coverDocument();
E(el).coverDocument();
E('myid').coverDocument();
The method returns the E object.
o = e.descendants([tag[, i]]);
els = E(el).descendants();
els = E('myid').descendants();
els = E(el).descendants('div');
el = E(el).descendants('div', 0);
Normally, the method returns an array (or array-like host object) or an element; but, if the index (i) is out of bounds, it will return undefined.
Note array-like host objects are live collections, so handle with results with care. Use the toArray function to convert to an array.
e.detachDrag([elHandle]);
E(el).detachDrag();
E('myid').detachDrag();
E(el).detachDrag(elHandle);
The method returns the E object.
e.dispatch(ev[, evType]);
E(el).dispatch('click');
E('myid').dispatch('click');
The method returns the E object.
doc = e.document();
doc = E(el).document();
doc = E('myid').document();
e.dropIn([options[, callback]]);
E(el).dropIn();
E('myid').dropIn();
E(el).dropIn({ ease:API.ease.circle, duration:1000 });
E(el).dropIn({ ease:API.ease.circle, duration:1000 }, fn);
The method returns the E object.
e.dropOut([options[, callback]])
E(el).dropOut();
E('myid').dropOut();
E(el).dropOut({ ease:API.ease.circle, duration:1000 });
E(el).dropOut({ ease:API.ease.circle, duration:1000 }, fn);
The method returns the E object.
e.empty();
E(el).empty();
E('myid').empty();
The method returns the E object.
el = e.element();
el = E(el).element();
E('myid').element();
The method returns an element.
e.fadeIn([options[, callback]]);
E(el).fadeIn();
E('myid').fadeIn();
E(el).fadeIn({ ease:API.ease.circle, duration:1000 });
E(el).fadeIn({ ease:API.ease.circle, duration:1000 }, fn);
The method returns the E object.
e.fadeOut([options[, callback]]);
E(el).fadeOut();
E('myid').fadeOut();
E(el).fadeOut({ ease:API.ease.circle, duration:1000 });
E(el).fadeOut({ ease:API.ease.circle, duration:1000 }, fn);
The method returns the E object.
e.foldIn([options[, callback]]);
E(el).foldIn();
E('myid').foldIn();
E(el).foldIn({ ease:API.ease.circle, duration:1000 });
E(el).foldIn({ ease:API.ease.circle, duration:1000 }, fn);
The method returns the E object.
e.foldOut([options[, callback]]);
E(el).foldOut();
E('myid').foldOut();
E(el).foldOut({ ease:API.ease.circle, duration:1000 });
E(el).foldOut({ ease:API.ease.circle, duration:1000 }, fn);
The method returns the E object.
e.fullScreen();
E(el).fullScreen();
E('myid').fullScreen();
The method returns the E object.
s = e.getAttribute(name);
s = E(el).getAttribute('class');
s = E('myid').getAttribute('class');
s = E(el).getAttribute('style');
The method returns a string or null.
v = e.getAttributeProperty(name);
s = E(el).getAttributeProperty('class');
s = E('myid').getAttributeProperty('class');
b = E(el).getAttributeProperty('readonly');
The method returns the property value or null.
s = e.getComputedStyle(style);
s = E(el).getComputedStyle('color');
s = E('myid').getComputedStyle('color');
s = E(el).getComputedStyle('backgroundColor');
The method returns the a string or null.
Note that as with all style-related functions, the name of the style must be in camel-case.
Note that this method will be made immediate in the near future.
o = e.getOpacity();
o = E(el).getOpacity();
o = E('myid').getOpacity();
The method returns a number from 0 to 1.
p = e.getPosition();
p = E(el).getPosition();
p = E('myid').getPosition();
The method returns an array.
d = e.getSize();
d = E(el).getSize();
d = E('myid').getSize();
The method returns an array.
s = e.getStyle(style);
s = E(el).getStyle('color');
s = E('myid').getStyle('color');
s = E(el).getStyle('backgroundColor');
The method returns a string or null.
s = e.getText();
s = E(el).getText();
s = E('myid').getText();
The method returns a string.
e.growIn([options[, fnDone]]);
E(el).growIn();
E('myid').growIn();
E(el).growIn({ ease:API.ease.circle, duration:1000 });
E(el).growIn({ ease:API.ease.circle, duration:1000 }, fn);
The method returns the E object.
e.growOut([options[, fnDone]]);
E(el).growOut();
E('myid').growOut();
E(el).growOut({ ease:API.ease.circle, duration:1000 });
E(el).growOut({ ease:API.ease.circle, duration:1000 }, fn);
The method returns the E object.
b = e.hasAttribute(name);
b = E(el).hasAttribute('class');
b = E('myid').hasAttribute('class');
The method returns a boolean.
b = e.hasClass(className);
b = E(el).hasClass('myclass');
b = E('myid').hasClass('myclass');
The method returns a boolean.
s = e.html([xhtml]);
html = E(el).html();
html = E('myid').html();
xhtml = E(el).html(true);
The method returns a string.
s = e.htmlOuter([xhtml]);
html = E(el).htmlOuter();
html = E('myid').htmlOuter();
xhtml = E(el).htmlOuter(true);
The method returns a string.
e.initiateDrag();
E(el).initiateDrag();
E('myid').initiateDrag();
e.insertAfter(el);
E(elInsert).insertAfter(el);
E('myid').insertAfter(el);
The method returns the E object.
e.insertBefore(el);
E(elInsert).insertBefore(el);
E('myid').insertBefore(el);
The method returns the E object.
b = e.isAncestor(el);
b = E(elAncestor).isAncestor(el);
b = E('myid').isAncestor(el);
The method returns a boolean.
b = e.isDescendant(el);
b = E('myid').isDescendant(elAncestor);
b = E(el).isDescendant(elAncestor);
The method returns a boolean value
b = e.isPresent();
b = E(el).isPresent();
b = E('myid').isPresent();
The method returns a boolean.
b = e.isTag(tag);
b = E(el).isTag('div');
The method returns a boolean.
b = e.isVisible();
b = E(el).isVisible();
b = E('myid').isVisible();
The method returns a boolean.
e.load(el);
E().load(el);
E().load('myid');
e.loadClone(deep);
E(el).loadClone();
e.loadHtml(html[, docNode]);
E().loadHtml('<p>And then...</p>');
e.loadNew(tag, attributesOrProperties, setProperties);
E().loadNew('div', { id:'you', 'class':'goodbye', disabled:'disabled' });
e.loadNext();
E(el).loadNext();
e.loadPrevious();
E(el).loadPrevious();
i = e.margin(side);
i = E(el).margin('left');
i = E('myid').margin('left');
i = E(el).margin('top');
The method returns a number of pixels.
o = e.margins();
o = E(el).margins();
o = E('myid').margins();
The method returns an object with properties named for each side (top, left, bottom and right), containing a number of pixels.
e.maximize([options[, callback]]);
E(el).maximize();
E('myid').maximize();
The method returns the E object.
e.off(ev, fn);
E(el).off('click', function() { window.alert('Clicked'); });
E('myid').off('click', function() { window.alert('Also clicked'); });
The method returns the E object.
e.offContextClick();
E(el).offContextClick();;
E('myid').offContextClick();;
The method returns the E object.
e.offHelp();
E(el).offHelp();
E('myid').offHelp();
The method returns the E object.
e.on(ev, fn[, context]);
E(el).on('click', function() { window.alert('Clicked'); });
E('myid').on('click', function() { window.alert('Also clicked'); });
E(el).on('click', function() { this.log('Object clicked'); }, someObject);
The method returns the E object.
E(id).onContextClick(fn[, context])
E(el).onContextClick(function() { window.alert('Context clicked'); });
E('myid').onContextClick(function() { window.alert('Also context clicked'); });
E(el).onContextClick(function() { this.log('Context clicked'); }, someObject);
The method returns the E object.
e.onHelp(fn[, context]);
E(el).onHelp(function() { window.alert('Help!'); });
E('myid').onHelp(function() { window.alert('Help yourself!'); });
E(el).onHelp(function(e) { this.showHelp(); }, someObject);
The method returns the E object.
e.onRoll(fnOver, fnOut[, context[, bAttachFocusListeners[, bSetStatus]]]);
E(el).onRoll(function() { window.status = 'over'; }, function() { window.status = 'and out'; } );
E('myid').onRoll(function() { window.status = 'roger'; }, function() { window.status = 'that'; } );
E(el).onRoll(function(e) { this.onover(e); }, function(e) { this.onout(e); }, someObject);
The method returns the E object.
b = e.overlaps(el);
b = E(elOverlay).overlaps(el);
The method returns a boolean.
e.overlay(el[, cover])
E(elOverlay).overlay(el);
E('myid').overlay(el);
E(elOverlay).overlay(el, true);
The method returns the E object.
e.position(y, x[, options[, callback]])
E(el).position(100, 100);
E('myid').position(0, 0);
E(el).position(100, 100, { duration:1000, ease:API.ease.circle });
The method returns the E object.
p = e.positionStyle();
p = E(el).positionStyle();
p = E('myid').positionStyle();
The method returns an array.
e.present(b[, display]);
E(el).present(); E(el).present(false); E(el).present(true, 'block'); E(el).present(true, 'inline');
The method returns the E object.
q = e.query(s);
q = E(el).query('div');
q = E('myid').query('div');
q = E(el).query('.myclass');
The method returns a Q object.
e.relative();
E(el).relative();
E('myid').relative();
The method returns the E object.
e.remove();
E(el).remove();
E('myid').remove();
The method returns the E object.
e.removeAttribute(name);
E(el).removeAttribute('class');
E('id').removeAttribute('class');
E(el).removeAttribute('style');
The method returns the E object.
e.removeClass(className);
E(el).removeClass('someclass');
E('myid').removeClass('someclass');
E(el).removeClass('someclass').removeClass('someotherclass');
The method returns the E object.
e.replace(el);
E(elReplacement).replace(el);
E('myid').replace(el);
The method returns the E object.
e.restore([options[, callback]]);
E(el).restore();
E('myid').restore();
E(el).restore({ duration:1000, ease:API.ease.circle });
The method returns the E object.
e.setAttribute(name, value);
E(el).setAttribute('class', 'myclass');
E(el).setAttribute('checked', 'checked');
E(el).setAttribute('tabindex', '2');
The method returns the E object.
e.setAttributeProperty(name, value);
E(el).setAttributeProperty('class', 'myclass');
E(el).setAttributeProperty('checked', true);
E(el).setAttributeProperty('tabindex', 2);
The method returns the E object.
e.setAttributes(attributes);
E(el).setAttributes({
class: 'myclass',
checked: 'checked',
tabindex: '2'
});
The method returns the E object.
e.setHtml(html[, options[, callback]])
E(el).setHtml('<p>This is a test</p>');
The method returns the E object.
e.setOpacity(o)
E(el).setOpacity(0.5);
The method returns the E object.
e.setOuterHtml(html, options, fnDone)
E(el).setOuterHtml('<p>This is a test</p>');
The method returns the E object.ss
e.setStyle(style, value)
E(el).setStyle('color', '#ff0000');
The method returns the E object.
e.setStyles(styles)
E(el).setStyles({
color: '#ff0000',
backgroundColor: '#0000ff'
});
The method returns the E object.
e.setText(text);
E(el).setText('This is a test');
E('myid').setText('This is a test');
The method returns the E object.
e.show(b[, options[, callback]]);
E(el).show();
E('myid').show();
E(el).show(false);
The method returns the E object.
e.size(h, w[, options[, callback]);
E(el).size(100, 100);
E('myid').size(100, 100);
The method returns the E object.
e.sizeOuter(h, w);
E(el).sizeOuter(100, 100);
E('myid').sizeOuter(100, 100);
The method returns the E object.
d = e.sizeStyle();
d = E(el).sizeStyle();
d = E('myid').sizeStyle();
The method returns an array.
e.springIn(elFrom[, options[, callback]]);
E(elPopup).springIn(el);
E('myid').springIn(el);
The method returns the E object.
e.springOut(elFrom[, options[, callback]]);
E(elPopup).springOut(el);
E('myid').springOut(el);
The method returns the E object.
e.toggle([options[, callback]]);
E(el).toggle();
The method returns the E object.
e.togglePresence([display]);
E(el).togglePresence();
E(el).togglePresence('inline');
E(el).togglePresence('block');
The method returns the E object.
e.update(uri, bAppend, updateOptions, fnUpdate, fnUpdated, requester)
E(el).update('http://www.cinsoft.net/');
E(el).update('http://www.cinsoft.net/', true);
E(el).update('http://www.cinsoft.net/', false, {
effects: API.effects.fade,
duration: 1000
});
The method returns the E object.
The F function constructs an object that abstracts a
form element. This constructor inherits from E.
Note to always use with the new
operator if calling the constructor from an alternate frame.
Creating F objects from forms in alternate frames does not
require the new operator.
f = F(id); f = new F(id);
var s, f = F(0); s = f.serialize(); f.send();
b = f.changed();
b = F(0).changed();
b = F('myname').changed();
The method returns a boolean.
e = f.controls(i);
els = F(0).controls();
els = F('myname').controls();
el = F('myname').controls(0);
The method returns an array or an element.
f.send([json[, requester]])
F(0).send();
F('nyname').send();
F(0).send(true);
F(0).send(true, requester);
The method returns the F object.
s = f.serialize();
s = F(0).serialize();
s = F('myname').serialize();
The method returns a string.
The I function constructs an object that abstracts
an image element. This constructor inherits from E.
Note to always use with the new
operator if calling the constructor from an alternate frame.
Creating I objects from images in alternate frames does not
require the new operator.
i = I(id); i = new I(id);
var i = I(0);
i.loadURI('testuri').slideIn({ duration:1000 }).on('click', function() { window.alert('Image clicked'); });
i.change(src[, options[, callback]])
I.change('http://www.cinsoft.net/images/cinsoft.gif');
I.change('http://www.cinsoft.net/images/cinsoft.gif', { effects: API.effects.fade, duration:1000, ease:API.ease.circle });
I.change('http://www.cinsoft.net/images/cinsoft.gif', { effects: [API.effects.fade, API.effects.grow], duration:1000, ease:API.ease.circle });
The method returns the I object.
The Q function constructs an object that abstracts
multiple elements.
Note to always use with the new
operator if calling the constructor from an alternate frame.
Creating Q objects that query documents in alternate frames
does not require the new operator.
q = Q(selector[, node]); q = new Q(selector[, node]);
var q = Q('div:last-child');
q.addClass('testclass').zoomIn({ duration:1000 }).on('click', function() { window.alert('Clicked'); });
q.load('div>div').addClass('testclass2').fadeIn({ duration:1000 }).on('click', function() { E(this).verticalBlindsOut({ duration:1000 }); });
q.load("#two.test1[test=test][test2]:first-child").slideIn({ duration:1000 }).on('click', function() { this.fadeOut({ duration:1000 }); }, q);
var q2 = Q([el1, el2, el3]);
q.addClass(className);
Q('.myclass').addClass('yourclass');
The method returns the Q object.
q.addHtml(html);
Q('.myclass').addHtml('<p></p>');
The method returns the Q object.
q.addMe([pos]);
Q('.myclass', el).addMe();
Q('.myclass', el).addMe(0);
The method returns the Q object.
q.append(selector[, node]);
Q('.myclass').append('.yourclass');
The method returns the Q object.
q.appendTo(el);
Q('.myclass').appendTo(el);
The method returns the Q object.
q.clear();
Q('.myclass').clear();
The method returns the Q object.
r = q.copy();
r = Q('.myclass').copy()
The method returns a new Q object.
q.dropIn([options[, callback]]);
Q('.myclass').dropIn();
The method returns the Q object.
q.dropOut([options[, callback]]);
Q('.myclass').dropOut();
The method returns the Q object.
q.empty();
Q('.myclass').empty();
The method returns the Q object.
q.evens();
Q('.myclass').evens();
The method returns the Q object.
q.every(fn[, context]);
Q('.myclass').every(function(el) { return API.hasClass(el, 'yourclass'); });
The method returns the Q object.
q.fadeIn([options[, callback]]);
Q('.myclass').fadeIn();
The method returns the Q object.
q.fadeOut([options[, callback]]);
Q('.myclass').fadeOut();
The method returns the Q object.
q.filter(fn[, context]);
Q('.myclass').filter(function() { return API.hasClass(el, 'yourclass'); });
The method returns the Q object.
r = q.find(selector);
r = Q('.myclass', el)
r = r.find('.yourclass');
The method returns a new Q object.
el = q.first();
el = Q('.myclass').first();
The method returns an element.
q.foldIn([options[, callback]]);
Q('.myclass').foldIn();
The method returns the Q object.
q.foldOut([options[, callback]]);
Q('.myclass').foldOut();
The method returns the Q object.
q.forEach(fn, context);
Q('.myclass').forEach(function() { API.addClass(el, 'yourclass'); });
The method returns the Q object.
q.growIn([options[, callback]]);
Q('.myclass').growIn();
The method returns the Q object.
q.growOut([options[, callback]]);
Q('.myclass').growOut();
The method returns the Q object.
b = q.hasAttribute(name);
b = Q('.myclass').hasAttribute('style');
The method returns a boolean.
b = q.hasClass(className);
b = Q('.myclass').hasClass('yourclass');
The method returns a boolean.
i = q.indexOf(el);
i = Q('.myclass').indexOf(el);
The method returns a number.
q.inject(pos[, selector[, node]]);
The method returns the Q object.
q.insertAfter(el);
The method returns the Q object.
q.insertBefore(el);
The method returns the Q object.
el = q.last();
el = Q('.myclass').last();
The method returns an element or undefined if the query is empty.
q.loadHtml(html[, docNode]);
Q().loadHtml('<p></p>');
Q().loadHtml('<p></p><div></div>');
The method returns the Q object.
a = q.map(fn[, context]);
a = Q('.myclass').map(function(el) { return el.id; });
The method returns an array.
q.odds();
Q(.myclass').odds();
The method returns the Q object.
q.off(ev, fn);
The method returns the Q object.
q.offContextClick();
Q('.myclass').offContextClick();
The method returns the Q object.
q.offHelp();
Q('.myclass').offHelp();
The method returns the Q object.
q.offMousewheel();
Q('.myclass').offMousewheel();
The method returns the Q object.
q.on(ev, fn[, context]);
Q('.myclass').on('click', function() { window.alert('Clicked'); });
The method returns the Q object.
q.onContextClick(fn, context);
The method returns the Q object.
q.onHelp(fn[, context]);
Q('.myclass').onHelp(function() { window.alert('Help!'); });
The method returns the Q object.
q.onMousewheel(fn[, context]);
Q('.myclass').onMousewheel(function(e, delta) { window.status = delta; });
The method returns the Q object.
q.onRoll(fnOver[, fnOut[, context[, attachFocusListeners[, setStatus]]]]);
Q('.myclass').onRoll(function() { window.alert('over'); }, function() { window.alert('out'); });
The method returns the Q object.
el = q.pop();
el = Q('.myclass').pop();
The method returns an element or undefined if the query is empty.
q.position(top[, left])
Q('.myclass').position(100, 100);
Q('.yourclass').position(0, 0);
The method returns the Q object.
q.prepend(selector[, node]);
Q('p').prepend('div');
Q('.myclass').prepend('.yourclass');
The method returns the Q object.
q.present(b[, display]);
Q(.myclass').present(); Q(.yourclass').present(false); Q(.myclass').present(true, 'block'); Q(.myclass').present(true, 'inline');
The method returns the Q object.
q.push(el1, [el2, ..., elN]);
Q('.myclass').push(el);
Q('.myclass').push(el1, el2);
The method returns the Q object.
el = q.random();
el = Q('.myclass').random();
The method returns an element.
q.remove();
Q('.myclass').remove();
The method returns the Q object.
q.removeAttribute(name);
Q('.myclass').removeAttribute('class');
The method returns the Q object.
q.removeClass(className);
Q('.myclass').removeClass('myclass');
The method returns the Q object.
q.reverse();
Q('.myclass').reverse()
The method returns the Q object.
q.setAttribute(name, value);
Q('.myclass').setAttribute('disabled', 'disabled');
Q('.myclass').setAttribute('title', 'This control is disabled.');
The method returns the Q object.
q.setAttributeProperty(name, value);
Q('.myclass').setAttributeProperty('disabled', true);
Q('.myclass').setAttributeProperty('title', 'This control is disabled.');
The method the Q object.
q.setHtml(html);
Q('.myclass').setHtml('<p></p>');
The method returns the Q object.
q.setOpacity(o);
Q('.myclass').setOpacity(0.5);
Q('.yourclass').setOpacity(0.75);
The method returns the Q object.
q.setStyle(style, value);
Q('.myclass').setStyle('backgroundColor', '#000');
The method returns the Q object.
q.setStyles(styles);
Q('.myclass').setStyles({ color:'#F00', backgroundColor:'#000' });
The method returns the Q object.
q.setText(text);
Q('.myclass').setText('This is a test.');
The method returns the Q object.
el = q.shift();
el = Q('.myclass').shift();
The method returns the Q object.
q.show(b[, options[, callback]]);
Q('.myclass').show();
Q('.myclass').show({ effects:API.effects.fade, duration:1000, ease:API.ease.circle });
The method returns the Q object.
q.size(h, w[, options[, callback]]);
Q('.myclass').size(100, 100);
Q('.myclass').size(100, 100, { duration:1000, ease:API.ease.circle });
The method returns the Q object.
q.sizeOuter(h, w);
Q('.myclass').sizeOuter(100, 100);
The method returns the Q object.
q.slice(begin[, end]);
Q('.myclass').slice(1);
Q('.myclass').slice(0, 1);
The method returns the Q object.
q.snip(pos, count);
Q('.myclass').snip(0, 1);
The method returns the Q object.
b = q.some(fn[, context]);
b = Q('.myclass').some(function(el) { return API.hasClass(el, 'yourclass'); });
The method returns a boolean.
q.splice(index, howMany, [el1][el2, ..., elN]);
Q('.myclass').splice(1, 2);
Q('.myclass').splice(1, 2, el);
The method returns the Q object.
s = q.toHtml([xhtml]);
html = q.toHtml(); xhtml = q.toHtml(true);
The method returns a string.
q.toggle([options[, callback]]);
Q('.myclass').toggle();
Q('.yourclass').toggle({ effects:API.effects.fade, duration:1000 });
The method returns the Q object.
q.togglePresence([display]);
Q('.myclass').togglePresence();
Q('.myclass').togglePresence('block');
Q('.yourclass').togglePresence('inline');
The method returns the Q object.
q.unshift(el1[, el2, ..., elN]);
Q('.myclass').unshift(el1, el2, el3, el4);
The method returns the Q object.
The W function constructs an object that abstracts a
window.
Note to always use with the new
operator if calling the constructor from an alternate frame.
Creating W objects from alternate frames does not require
the new operator.
w = W([window]); w = new W([window]);
var w = W();
var s = w.getViewportSize();
w.setStatus('Viewport size ' + s);
w.addBookmark('http://www.cinsoft.net/mylib.html', 'My Library');
w.addBookmark(uri[, title]);
W().addBookmark('http://www.hartkelaw.net', 'Hartke Law Firm')
W(win).addBookmark('http://www.hartkelaw.net', 'Hartke Law Firm')
The method returns the W object.
w.addBookmarkCurrent();
W().addBookmarkCurrent() W(win).addBookmarkCurrent()
The method returns the W object.
p = w.getEnabledPlugin(mimeType[, title]);
p = W().getEnabledPlugin('audio/x-wav');
p = W(win).getEnabledPlugin('audio/x-wav');
The function returns a string or null if an enabled plugin is not found.
frame = w.getFrameById(id);
frame = W().getFrameById('myid');
frame = W(win).getFrameById('myid');
The method returns a window object or null if none is found.
doc = w.getIFrameDocument(el);
doc = W().getIFrameDocument(el); doc = W(win).getIFrameDocument(el);
The method returns a document.
w.off(ev, fn);
W().off('resize', fn);
W(win).off('resize', fn);
W().off('scroll', fn);
The method returns the W object.
w.on(ev, fn[, context]);
W().on('resize', function() { window.status = 'Resized'; });
W(win).on('resize', function() { window.status = 'Resized'; });
W().on('scroll', function(e) { this.onscroll(e); }, someObject);
The method returns the W object.
w.setStatus(text);
W().setStatus('Hello!');
W(win).setStatus('Hello to you!');
The method returns the W object.
s = w.viewportSize();
s = W().viewportSize(); s = W(win).viewportSize();
The method returns an array containing the height and width of the viewport in pixels.
By David Mark