How to Create a Responsive Design for eBay ePN ads

ebay-pn-logo Responsive Design

Overview

For resposive web designers: Ads are big trouble.
In the next article I will explain how to edit the JS script to a responsive design for your eBay ads.

 

The solution

Replace the document.write(‘\x3Csc… } in the following script with your ebay ads code, and you’ll support several sizes of the add for different screen width.

<script type="text/javascript" src='http://adn.ebay.com/files/js/min/ebay_activeContent-min.js'></script>
<script charset="utf-8" type="text/javascript">
var width = window.innerWidth || document.documentElement.clientWidth;
if (width >= 800) {
document.write('\x3Csc... }
else if ((width < 800) && (width > 350)) {
document.write('
\x3Csc...
} else {
document.write('\x3Csc...
}
</script>

 

Happy coding…

1 thought on “How to Create a Responsive Design for eBay ePN ads

  1. Eric M

    Thanks, this has worked well. Is the third entry “else” sort of a fallback in case the size of the screen cannot be detected?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.