• Skip to primary navigation
  • Skip to main content
Matthew Dunbar

Matthew Dunbar

Hire Me
  • About
  • Portfolio
  • Blog
    • General
    • HTML
    • jQuery
    • PHP
    • Optimization
  • Hire Me
You are here: Home / Archives for jQuery

jQuery

How to Add a Preloader to Your Genesis Website

February 26, 2017

This preloader guide will teach you how to properly add a jQuery preloader to your WordPress website using the Genesis Framework.

Simply create or search google for free preloading .gifs to place in the background: url() in the .preloader class in your CSS.

The CSS



.preloader {
	position: fixed;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 100%;
	z-index: 19999;
	background: url('../images/89.gif') 50% no-repeat #222;
}

The PHP



add_action( 'genesis_before', 'add_preloader', 1 );
function add_preloader() {
	echo '<div class="preloader"></div>';
}

The jQuery



	$(window).load(function() {
		$(".preloader").delay(350).fadeOut('slow');
	});

Filed Under: CSS, jQuery, PHP

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Interim pages omitted …
  • Page 8
  • Go to Next Page »
© 2025 Matthew Dunbar - All Rights Reserved Back to Top