In this post I'm going to show you how to create an image slideshow where all the images are fetched via AJAX. To accomplish this, we'll create a PHP script that loops through all the images of a directory, stores them into an array, sorts this array by date and finally returns a JSON object. If you're not accustomed to PHP programming, don't worry: it's sufficient to say that the main work is done by the json_encode() function combined with the appropriate HTTP header (here set to application/json) and that the PHP script must be put in the same directory of your images. Said that, here's the core of our slideshow:
jQuery: sticky blog dates
In this post I'm going to show how to create sticky blog dates using jQuery and CSS. CSS will be used to display our dates in the correct position, while jQuery will provide the basic date formatting. My source of inspiration for this post is the Wordpress Lightword theme, though I made some minor changes to the date formatting. As always, let's start with our markup structure:
jQuery: plugin documentation best practices
One of the most frequent reasons of failure for a jQuery plugin (and also one of the most frequent causes of frustration for users) is when a plugin is poorly documented. It doesn't matter if the plugin in question is stunning and a real masterpiece of the finest jQuery coding ever seen because what users need is to understand how a given plugin works and how they can configure it to make it suit their needs. The first thing to bear in mind while writing your plugin documentation is to provide all the information that a user may need. Explaining the basic configuration options of your plugin is not writing a documentation, but simply provide the minimum information required. Of course this is not enough, because users usually need more. I know that because I made this mistake myself.