/** * @author Suker */ var callAdSceneInGame, closeAdSceneInGame; (function() { var _topFrameDom, _bottomFrameDom; callAdSceneInGame=function(game_code){ crossAjax({ url:server.advUrl, data:{ game_code:game_code }, type:'post', dataType:'json', success:function(res){ if(res.count>0){ var advJsArray=[]; for(var i=0;i', ' ', ' ', '', '
' ].join(''); setTimeout(function() { _topFrameDom.style.Transform = 'translate3d(0px, 50px, 0px)'; _topFrameDom.style.WebkitTransform = 'translate3d(0px, 50px, 0px)'; _topFrameDom.style.MozTransform = 'translate3d(0px, 50px, 0px)'; _topFrameDom.style.OTransform = 'translate3d(0px, 50px, 0px)'; _topFrameDom.style.MSTransform = 'translate3d(0px, 50px, 0px)'; }, 100); break; case 1: //在下面显示广告条 if (!_bottomFrameDom) { _bottomFrameDom = document.createElement('div'); _bottomFrameDom.style.position = 'absolute'; _bottomFrameDom.style.zIndex = 1000000; _bottomFrameDom.style.left = '0px'; _bottomFrameDom.style.width = '100%'; _bottomFrameDom.style.height = '50px'; _bottomFrameDom.style.background = 'url('+baseUrl+'adSceneLogo2.png) no-repeat'; _bottomFrameDom.style.transition = '-webkit-transform 1s'; _bottomFrameDom.style.WebkitTransition = '-webkit-transform 1s'; _bottomFrameDom.style.MozTransition = '-moz-transform 1s'; _bottomFrameDom.style.OTransition = '-o-transform 1s'; _bottomFrameDom.style.MSTransition = '-ms-transform 1s'; if (document.body) { document.body.appendChild(_bottomFrameDom); _bottomFrameDom.onmouseup = function(e) { if (e.target.id == 'closeBtnBottom') { closeAdSceneInGame(1); } }; _bottomFrameDom.ontouchend = _bottomFrameDom.onmouseup; } } _bottomFrameDom.style.top = (window.innerHeight) + 'px'; _bottomFrameDom.innerHTML = [ '
', ' ', ' ', ' ', ' ', '
', '
' ].join(''); setTimeout(function() { _bottomFrameDom.style.Transform = 'translate3d(0px, -50px, 0px)'; _bottomFrameDom.style.WebkitTransform = 'translate3d(0px, -50px, 0px)'; _bottomFrameDom.style.MozTransform = 'translate3d(0px, -50px, 0px)'; _bottomFrameDom.style.OTransform = 'translate3d(0px, -50px, 0px)'; _bottomFrameDom.style.MSTransform = 'translate3d(0px, -50px, 0px)'; }, 100); break; } }; //关闭 closeAdSceneInGame = function(style) { switch (style) { case 0: //在上面显示广告条 default: if (_topFrameDom) { if (document.body) { document.body.removeChild(_topFrameDom); _topFrameDom = null; } } break; case 1: //在下面显示广告条 if (_bottomFrameDom) { if (document.body) { document.body.removeChild(_bottomFrameDom); _bottomFrameDom = null; } } break; } }; })();