Posting Multiple Logos on a single landing page | Community
Skip to main content
February 23, 2015
Question

Posting Multiple Logos on a single landing page

  • February 23, 2015
  • 2 replies
  • 1017 views
Hi there,
We are trying to post partner logos on a landing page, but would like to use a single page and be able to generate the image based on the URL link they are clicking. Is this doable?
Thanks,
Michelle
 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SanfordWhiteman
Level 10
February 23, 2015
Of course. First, parse the value from the URL (query string) using JavaScript.

Then you can use any one of various techniques to change/add the logos:
  • Add a class to an element that changes the background-image using an existing CSS selector: H2.partner1 { background-image: url(http://pages.example.com/partnerimage1.png) } 
  • Add a class to the BODY or other parent element and do the same thing: BODY.partner1 H2 { ... }
  • Inject an image element directly into the page: document.createElement('IMG')... imageEl.src='partnerimage1.png'... appendChild(imageEl)... etc.
  • Whatever else fits with your markup and scripting habits
SanfordWhiteman
Level 10
February 24, 2015
Simple examples:

    fiddle.jshell.net/syd2402c/2/show/?sports
    fiddle.jshell.net/syd2402c/2/show/?nightlife