0x54 Posted February 9, 2015 Share Posted February 9, 2015 Please forgive me for my lack of knowledge of Javascript or front end web in general! I've got a Pixi.js game which reads the viewport width and height and sets itself to occupy the entire area. I now need to put an adsense ad over the top of the game. It would be a lot of effort to rescale the game so it no longer uses the whole viewport, as things like centering would be thrown off as a result. So if possible I would like to have the ad displayed over the top. Is this possible? Can I give the adsense code an absolute position, on the far right? Here is an example of adsense embed code: <script type="text/javascript"> google_ad_client = "somenumberhere"; google_ad_slot = "another-id"; google_ad_width = 120; google_ad_height = 600;</script><script type="text/javascript"src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script> There's also the asynchronous code type: <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:inline-block;width:120px;height:600px" data-ad-client=some-id-here" data-ad-slot="another-id"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script> All advice greatly appreciated! Quote Link to comment Share on other sites More sharing options...
xerver Posted February 17, 2015 Share Posted February 17, 2015 You can just style the element the adsense code will drop in to be absolute and positioned to the right. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.