(function (win) { var Brand = { init : function(config) { //console.log(config); var url = "http://www.cctvfxpp.com/brand/popshow?brand_sn=YXPP0011206&style=1&pos=1&v="; try{ var iframe = document.createElement(''); }catch(e){ var iframe = document.createElement('iframe'); iframe.name = 'brandFrame'; } iframe.frameborder = "0"; iframe.scrolling = "no"; iframe.src = url; var style = { position : "fixed","border" : "0px", "z-index" : "100000", "height" : "250px", "width" : "250px" }; var dotop = -30 + config.num; style["top"] = "50%"; switch (config.pos) { case 1 : style["left"] = "0px"; break; case 2 : style["right"] = "0px"; break; } style["marginTop"] = dotop + "px"; this.style(iframe, style); document.body.appendChild(iframe); }, style : function(obj, style) { for (var i in style) { obj.style[i] = style[i]; } } }; Brand.init({"style":1,"pos":1,"num":0}); })(window);