How to use the xui.Dom function in xui

To help you get started, we’ve selected a few xui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github linb / CrossUI / xui2.0 / xui / js / Tips.js View on Github external
t1.innerHTML=s;
                        //set dimension
                        if(xui.browser.ie){
                            style.width=styleI.width=(self._w=Math.round(w+(w%2)))+'px';
                            h=t1.offsetHeight;
                            style.height=(self._h=Math.round(h-(h%2)))+'px';
                        }else{
                            styleI.width=(self._w=Math.round(w))+'px';
                            self._h=self.n.height();
                        }

                        if(pos===true){
                            style.visibility='visible';
                        }else{
                            //pop(visible too)
                            node.popToTop((pos['xui.UI'] || pos['xui.UIProfile'] || pos['xui.Dom'] || pos.nodeType==1 || typeof pos=='string')?pos:{left:pos.left,top:pos.top,region:{
                                left:pos.left,
                                top:pos.top-12,
                                width:24,
                                height:32
                            }},1);
                        }
                        
                        style=styleI=t1=null;
                    }else
                        node.css('zIndex',0).hide();
                };
                this.hide = function(){
github linb / CrossUI / xui2.0 / xui / js / UI / PopMenu.js View on Github external
xui.each(prf.$allPops,function(pop){
                    if(pop && !pop.$noDestroyByParentMenu){
                        if(pop['xui.UI'] && !pop.isEmpty() && !pop.isDestroyed()){
                            pop.destroy();
                        }else if(pop['xui.UIProfile'] && !pop.destroyed){
                            pop.__gc();
                        }else if(pop['xui.Dom'] && !pop.isEmpty() ){
                            pop.remove();
                        }
                    }
                });
            };
github linb / CrossUI / xui1.3 / xui / js / Tips.js View on Github external
style.visibility='hidden';
                        //set content
                        t1.innerHTML=s;
                        //set dimension
                        if(xui.browser.ie){
                            style.width=styleI.width=w+(w%2)+'px';
                            h=t1.offsetHeight;
                            style.height=h-(h%2)+'px';
                        }else
                            styleI.width=w+'px';

                        if(pos===true){
                            style.visibility='visible';
                        }else{
                            //pop(visible too)
                            node.popToTop((pos['xui.UI'] || pos['xui.UIProfile'] || pos['xui.Dom'] || pos.nodeType==1 || typeof pos=='string')?pos:{left:pos.left,top:pos.top,region:{
                                left:pos.left,
                                top:pos.top-12,
                                width:24,height:32
                            }},1);
                        }
                        
                        style=styleI=t1=null;
                    }else
                        node.css('zIndex',0).hide();
                };
                this.hide = function(){
github linb / CrossUI / xui / js / Tips.js View on Github external
//set dimension
                            if(xui.browser.ie){
                                style.width=styleI.width=(self._w=Math.round(w+(w%2)))+'px';
                                h=t1.offsetHeight;
                                style.height=(self._h=Math.round(h-(h%2)))+'px';
                            }else{
                                styleI.width=(self._w=Math.round(w))+'px';
                                self._h=self.n.height();
                            }
                            
                            node.removeClass('xui-ui-hidden');
                            if(pos===true){
                                style.visibility='visible';
                            }else{
                                //pop(visible too)
                                node.popToTop(((pos instanceof window.Event) || pos['xui.UI'] || pos['xui.UIProfile'] || pos['xui.Dom'] || pos.nodeType==1 || typeof pos=='string')?pos:{left:pos.left,top:pos.top,region:{
                                    left:pos.left,
                                    top:pos.top-12,
                                    width:24,
                                    height:32
                                }},1);
                            }
                            
                            style=styleI=t1=null;
                        }else
                            node.css('zIndex',0).hide();
                    }
                };
                this.hide = function(){
github linb / CrossUI / xui1.0 / xui / js / Dom.js View on Github external
_ensureValues:function(obj){
            var t,i,map=this._map,a=[],
            //can't be obj, or opera will crash
            arr =  obj===window
                    ? ['!window']
                    : obj===document
                    ? ['!document']
                    : obj.constructor == Array
                    ? obj
                    : obj['xui.Dom']
                    ? obj._nodes
                    : obj._toDomElems
                    ? obj._toDomElems()
                    : typeof obj == 'function'
                    ? obj()
                    :[obj];
            for(i=0;i
github linb / CrossUI / xui1.0 / xui / js / Dom.js View on Github external
popToTop : function(pos, type, parent){
            var region, target=this,  t;

            parent=xui(parent);
            if(parent.isEmpty())parent=xui('body');

            //prepare
            target.css({position:'absolute',left:xui.Dom.HIDE_VALUE, top:xui.Dom.HIDE_VALUE,display:'block', zIndex:xui.Dom.TOP_ZINDEX});

            if(pos['xui.Dom'] || pos.nodeType==1 || typeof pos=='string'){
                type = (type || 1).toString();
                var node=xui(pos),
                    //base region
                    abspos = node.offset(null, parent);
                region = {
                    left:abspos.left,
                    top:abspos.top,
                    width:node.offsetWidth(),
                    height:node.offsetHeight()
                };
             }else{
                type = type?'3':'0';
                t=type=='0'?0:8;
                region = pos.region || {
                    left:pos.left-t,
                    top:pos.top-t,
github linb / CrossUI / xui1.0 / xui / js / Dom.js View on Github external
if(b){
                            _.tryF(v.trigger,[p,e],v.target);
                            _.arr.removeValue(arr,i);
                            delete arr[i];
                        }else if(v.stopNext){
                            //if the top layer popwnd cant be triggerred, prevent the other layer popwnd trigger
                            return false;
                        }
                    },null,true);
                    a.length=0;
                }),
                arr=fun.arr||(fun.arr=[]),
                target;
            if(group){
                //keep the original refrence
                if(group['xui.Dom'])
                    target=group;
                else if(_.isArr(group)){
                    target=xui();
                    target._nodes=group;
                }
            }else
                target=ns;

            if(!doc.onmousedown)doc.onmousedown=xui.Event.$eventhandler;            target.each(function(o){if(!o.id)o.id=xui.Dom._pickDomId()});
            target.each(function(o){if(!o.id)o.id=xui.Dom._pickDomId()});
            //remove this trigger
            if(!trigger){
                _.arr.removeValue(arr,id);
                delete arr[id];
            //double link
            }else