Extra Drupal Body Classes

You can programmatically add extra classes to the body tag via the themes template.php. function themename_preprocess_html(&$variables) { // Add a extra class to the body element $variables['classes_array'][] = 'body__bg-color'; } »

JQuery Match Height For Elements

I needed to match the height of multiple div’s that contained an image and text, but the amount of text was never a set amount. I’ve created a fiddle for this. See it here // Fire the function on window resize $(window).on('resize',matchHeight); // Set up function function matchHeight() { // If the window width is tablet or desktop if ($(window).width() > 767 ) { // Reset the height for resize $('. »

JQuery Opacity Image Based Scroll

I had a recent project where the page title has a background image and said image was to fade as the user started scrolling down the page. The JQuery code below is who I archive it but you can go my JSfiddle to see it in action: Fiddle me this // Fade out the page title image as user scrolls var fadeStart = 0; // 0 scroll or less will equiv to 1 opacity var fadeUntil = 300; // 300px scroll or more will equiv to 0 opacity var fading = $('. »