Custom bookmarklets

This is a very simple & specific bookmarklet to hide the annoying footer banner advert on the otherwise great website webdesignledger.com – I love the site but for some reason I find footer adverts very annoying.

After seeing this new Smashing Magazine tutorial: Make Your Own Bookmarklets With jQuery the other day, I thought I’d see if I could make my own.

Drag the following link to your bookmarks bar

FooterAdKiller

To design your own, simply copy the below code, and add it to your bookmark. The key is adding your own jQuery in the runthis function. I chose a couple of annoying advert div blocks on sites I visit regularly, and hide them on click.

if (typeof jQuery == 'undefined') {
	var jQ = document.createElement('script');
	jQ.type = 'text/javascript';
	jQ.onload=runthis;
	jQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
	document.body.appendChild(jQ);
} else {
	runthis();
}

function runthis() {
	$('#bottomPremiumBanner, #follow_share_post').hide('fast');
}

I know I could use adblock but I prefer to help content sites make a living from their work – this way the ad is rendered and then hidden on the client side, so to log files the image has been displayed.

Leave a Reply