Makepovertyhistory.org's cornerwhitebandsmallright css/javascript

Submitted by mgifford on

I saw this a few times, but wanted to make sure I'd be able to find it again. Haven't seen other campaign sites with banners like this, but totally see how it could be a useful form of promotion.

The javascript just provides referrer information for make poverty history.. Probably better ways to do this, but interesting.. The banner fits in very nicely with the white wristband that this campaign uses. Could also be used quite effectively with breast cancer campaigns or any of the ribbon campaigns out there.

// Current Page Reference
// copyright Stephen Chapman, 1st Jan 2005
// you may copy this function but please keep the copyright notice with it
function getURL(uri) {
uri.dir = location.href.substring(0,location.href.lastIndexOf('\/'));
uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {
uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);
}
uri.page = location.href.substring(uri.dir.length+1,location.href.length+1);
pos = uri.page.indexOf('?');
if (pos > -1) {
uri.page = uri.page.substring(0, pos);
}
pos = uri.page.indexOf('#');
if (pos > -1) {
uri.page = uri.page.substring(0, pos);
}
uri.ext = ''; pos = uri.page.indexOf('.');
if (pos > -1) {
uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);
}
uri.file = uri.page;
if (uri.ext != '') uri.file += '.' + uri.ext;
if (uri.file == '') uri.page = 'index';
uri.args = location.search.substr(1).split("?");
return uri;
}

var uri = new Object();
getURL(uri);

document.write('<style><!--
@import url(http://www.makepovertyhistory.org/whiteband.css);
--></style>' +
'<div class="MPHWhiteBandSmallRight">
<img xsrc="http://www.makepovertyhistory.org/whiteband_mphtranslinkimg.gif"
width="163" height="163" border="0" usemap="#MPHLinkMapSmallRight">
</div>'
+
'<map name="MPHLinkMapSmallRight"><area shape="poly" coords="0,0,163,163,163,133,30,0"
xhref="http://www.makepovertyhistory.org/index.shtml?entry=cornerwhitebandsmallright&referrer=' + uri.dom + '"
target="_blank"></map>'
);

To see a good examples of the CSS that we have used.

Also worth checking out this blog post with some other tips. If you want help to track and spread the brand for your campaign, we can help.

  • HTML
  • Computing
  • Span and div
  • JavaScript
  • HTML element
  • http://www.makepovertyhistory.org/whiteband.css
  • http://www.makepovertyhistory.org/index.shtml?entry=cornerwhitebandsmallright&referrer='
  • dom
  • http
  • Stephen Chapman
  • http://www.makepovertyhistory.org/whiteband mphtranslinkimg.gif

Section: 

Topic: 

Add new comment