May 31, 2015

Preloading Images with Jquery

There are times when preloading images is an important step in keeping your site/page/program running smoothly. This is especially true in the era of mobile. Here’s a cute little snippet that does just that. function preload(yourarrayOfImages) { $(yourarrayOfImages).each(function(){ $(‘<img/>’)[0].src = this; }); } preload([ ‘img/image1.jpg’, ‘img/image2.jpg’, ‘img/image3.jpg’ ]);  

Preloading Images with Jquery Read More »

WP: Adding a HTML5 Search Form

A simple script from your local Gainesville Web Designer. [code scroll=”false” language=”htmml”] <form role=”search” method=”get” class=”search-form” action=”<?php echo home_url( ‘/’ ); ?>”> <label> <span class=”screen-reader-text”><?php echo _x( ‘Search for:’, ‘label’ ) ?></span> <input type=”search” class=”search-field” placeholder=”<?php echo esc_attr_x( ‘Search …’, ‘placeholder’ ) ?>” value=”<?php echo get_search_query() ?>” name=”s” title=”<?php echo esc_attr_x( ‘Search for:’, ‘label’ ) ?>” /> </label> <input type=”submit”

WP: Adding a HTML5 Search Form Read More »