css strike的使用3

发布时间:2014-10-25 2:22:00
来源:分享查询网

var TinyFw=function(){    var ua = navigator.userAgent.toLowerCase();    var isStrict = document.compatMode == "CSS1Compat",        isOpera = ua.indexOf("opera") > -1,        isIE = !isOpera && ua.indexOf("msie") > -1;    return {        isIE : isIE,        isStrict : isStrict,        isArray : function(v){   return v && typeof v.length == 'number' && typeof v.splice == 'function';  }     };          }(); TinyFw.DomHelper={        createDom : function(o, parentNode){        var el;        if (TinyFw.isArray(o)) {                       // Allow Arrays of siblings to be inserted            el = document.createDocumentFragment(); // in one shot using a DocumentFragment            for(var i = 0, l = o.length; i < l; i++) {                createDom(o[i], el);            }        } else if (typeof o == "string") {         // Allow a string as a child spec.            el = document.createTextNode(o);        } else {            el = document.createElement(o.tag||'div');            var useSet = !!el.setAttribute; // In IE some elements don't have setAttribute            for(var attr in o){                if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || attr == "style") continue;                if(attr=="cls"){                    el.className = o["cls"];                }else{                    if(useSet) el.setAttribute(attr, o[attr]);                    else el[attr] = o[attr];                }            }            TinyFw.DomHelper.applyStyles(el, o.style);            var cn = o.children || o.cn;            if(cn){                createDom(cn, el);            } else if(o.html){                el.innerHTML = o.html;            }        }        if(parentNode){           parentNode.appendChild(el);        }        return el;    },        setStyle : function(el, property, val) {        switch (property) {            case 'float':                property = TinyFw.isIE ? 'styleFloat':'cssFloat';            default:            el.style[property] = val;        }    },       applyStyles : function(el, styles){        if(styles){           if(typeof styles == "string"){               var re = //s?([a-z/-]*)/:/s?([^;]*);?/gi;               var matches;               while ((matches = re.exec(styles)) != null){                   this.setStyle(el,matches[1], matches[2]);               }           }else if (typeof styles == "object"){               for (var style in styles){                  this.setStyle(el,style, styles[style]);               }           }        }    }}; function createToolbar(){    }

返回顶部
查看电脑版