how to make this 728x90 pixel banner code responsive?

Asked

Viewed 397 times

1

This is the banner code of an affiliate program, size 728x90 pixels. I put him on the blog but on mobile the banner is getting cut, could help?

<!-- Começo -->
<script type="text/javascript" language="javascript">
    lmd_source="35882772";
    lmd_si="33921764";
    lmd_pu="22765282";
    lmd_c="BR";
    lmd_wi="728";
    lmd_he="90";
</script>
<script src="http://image.lomadee.com/js/ad_lomadee.js" type="text/javascript" language="javascript"></script>
<!-- fim -->
  • Improve the question There’s no helping you with just that!

2 answers

2

Unfortunately that is not possible.

These ads are fixed size and create a frame on the page where you won’t be able to make changes (I don’t know Lomadee, but Adsense has a banner option for responsive design). Besides, it probably violates the program’s Terms of Use. Therefore, it is not recommended to change characteristics of ads banners, otherwise you will be banned from the system.

A solution that pulls a banner with specific width for each screen, is this proposal in this article related to Adsense, but I believe it is possible to adapt it to Lomadee.

How it works?

When opening the site, according to the window.innerWidth, the script will load the banner that fits to the width of the screen.

Possible problem: (but not so important)

If the page opens on an iPad, for example in the "landscape" position (device horizontal) and loads the 728x90 pixel banner, when the user turns to the "portrait" position (vertical), the banner will be cut, because the width in pixels at the "portrait" position is minor. However, I believe that this is not a big problem, because the user on mobile devices has more tendency to open in the "landscape" position than in the "portrait". And if it open in the "portrait" position initially, better yet, because if moving to "landscape" the banner will not be cut.

inserir a descrição da imagem aqui

0

Dear friend,

Change the following line

lmd_wi="728";

for

lmd_wi="100%";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.