The constructor with ZKuery is $init. You could take a look at
http://www.zkoss.org/javadoc/latest/jsdoc/zk/Widget.html#$init%28_global_.Map%29
Complete JS API:
http://www.zkoss.org/javadoc/latest/jsdoc/
Here is an example of jq.alert:
jq.alert = function (msg, opts) {
if (opts && opts.mode == 'os')
return $alert(msg);
opts = opts || {};
zk.load("zul.wnd,zul.wgt,zul.box", function () {
var wnd = new zul.wnd.Window({
closable: true,
width: '250pt',
title: opts.title||'ZK',
border: 'normal',
children: [
new zul.box.Box({
mold: 'horizontal',
children: [
new zul.wgt.Div({sclass: icons[(opts.icon||'').toUpperCase()]||
icons.INFORMATION}),
new zul.wgt.Div({
sclass: 'z-messagebox',
width: '210pt',
children: [
new zul.wgt.Label({
value: msg,
multiline: true
})
]
})
]
}),
new zul.wgt.Separator({bar: true}),
new zul.box.Box({
mold: 'horizontal',
style: 'margin-left:auto; margin-right:auto',
children: getButtons(opts.button)
})
],
mode: opts.mode||'modal'
});
var p = opts.desktop || zk.Desktop.$();
if (p && (p = p.firstChild) && p.desktop)
p.appendChild(wnd);
else
jq(document.body).append(wnd);
});
};