How to Create a Responsive Design for eBay ePN ads

ebay-pn-logo Responsive Design


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=''></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)) {
} else {


Happy coding…

Development Specialist, Artist and Activist
Personal Website

One 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?


Leave a Reply

Your email address will not be published.