Skip to content

Instantly share code, notes, and snippets.

Last active Dec 24, 2015
What would you like to do?
Code used to autumnify CNN's topic headers. Try this in your JavaScript console on CNN. This code is waaaay more complicated than normal Autumn use (loading scripts and such), so please don't be put off by that.
function autumnify(){jQuery.getScript("//", function(){jQuery.getScript("//", function(){jQuery(".cnn_sectbincntnt2 h4").each(function(i,e){jQuery.fn.autumn.init({colorProfile:'dark'});var g = jQuery.fn.autumn.getGradientColors(i);jQuery(this).css({'background-image':'linear-gradient(to top, '+g[1]+','+g[0]+')'});});});});}if(!window.hasOwnProperty('jQuery')){var s = document.body.appendChild(document.createElement('script')); s.src = '//';s.onload = autumnify;}else{autumnify();}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment