Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 05-17-2016, 08:24 AM
CorneliusW CorneliusW is offline
Junior Member
 
Join Date: 06-08-04
Posts: 5
iTrader: 0 / 0%
How to make ads responsive

I am a publisher of ad networks, and I wanted to make the 728x90 and 468x60 banner ads responsive since they're cut off on mobile due to width. My first thought was to show a 300x250 in placement of the 728 and 468 banners on mobile devices only. So I created the following code:

Code:
<div class="container"> <script> window.onresize = function(){ var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); if ( $(window).width() <= 767) { e9 = new Object(); e9.size = "320x50"; script.src = "tags.expo9.exponential.com/tags/comMobile/320x50/tags.js"; head.appendChild(script); }else { e9 = new Object(); e9.size = "728x90"; script.src = "tags.expo9.exponential.com/tags/com/ROS/tags.js"; head.appendChild(script); } } </script> </div>
But that didn't display any banner ad, it left the header blank. So that code does not work, not sure what I wrote wrong as I can't detect an issue. Now I'm thinking perhaps there is a way to make the 728x90 and 468x60 responsive, as they pay out more than the 300x250, so why lose out on those sizes?

Is it possible to make it responsive? If so what do I have to do? If it's not possible, then can someone take a look at my javascript above and potentially fix it?

Here are the original ad codes:

728x90

Code:
<div class="container"> <!-- Ezoic - Under Page Title - under_page_title --> <div id="ezoic-pub-ad-placeholder-101"> <script type="text/javascript"><!-- e9 = new Object(); e9.size = "728x90,970x250"; //--></script> <script type="text/javascript" src="tags.expo9.exponential.com/tags/com/ROS/tags.js"></script> </div> <!-- End Ezoic - Under Page Title - under_page_title --> </div>
300x250
Code:
<script type="text/javascript"><!-- e9 = new Object(); e9.size = "320x50"; //--></script> <script type="text/javascript" src="tags.expo9.exponential.com/tags/comMobile/320x50/tags.js"></script>
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 05-23-2016, 04:32 AM
blizzardofozz blizzardofozz is offline
Junior Member
 
Join Date: 05-23-16
Posts: 22
iTrader: 0 / 0%
How about making the banner size not pixels but percentage? If this is not working just go CSS @media rule.
 
Reply With Quote
  #3  
Old 06-13-2016, 03:31 PM
RyanVarnals's Avatar
RyanVarnals RyanVarnals is offline
Junior Member
 
Join Date: 06-10-16
Location: Oceanside, CA
Posts: 16
iTrader: 0 / 0%
Does the website already have bootstrap.css on it? If it does you can add the class "col-sm-12" and it will make it fill 100%. If you don't have boostrap, it's super easy to get.
 
Reply With Quote
  #4  
Old 09-13-2016, 04:33 AM
BuckyDroid BuckyDroid is offline
Junior Member
 
Join Date: 09-13-16
Posts: 6
iTrader: 0 / 0%
noice
 
Reply With Quote
  #5  
Old 09-13-2016, 06:28 AM
snakeair snakeair is offline
Super Moderator - Rest in Peace 2018
 
Join Date: 12-31-07
Location: Medford, NJ
Posts: 54,771
iTrader: 3 / 100%
Quote:
Originally Posted by BuckyDroid View Post
noice
What?
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Responsive css help please georgeweballey13 Coding Forum 2 12-30-2014 07:25 AM
Looking For Someone to Make Site Responsive commoditytrainer Buy Web Services 3 04-22-2013 03:35 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 10:21 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC