Skip to Content

Creating a JavaScript slideshow: the HTML structure

A JavaScript slideshow (or slider) is made up of three main components: an HTML structure, a CSS presentation and a JavaScript behavior. These components work together to make the slideshow work in the way it should, that is, to allow users to navigate through a series of items. In this article we’ll cover in depth the first component, the HTML structure.

Continue Reading

WordPress: handling user meta

We’re usually accustomed to store the metadata associated to WordPress posts and pages by using the update_post_meta() function. This of course works for posts but what about WordPress users? WordPress already provides a series of fields in each user’s profile. These fields, however, fall short when it comes to associate other types of values to user, for example their orders or their preferences about the contents of our site.

Continue Reading

jQuery: calculating slide dimensions on responsive slideshows

Responsive slideshows are interesting: if you try to use the width(), outerWidth(), innerWidth() jQuery’s methods, a 0 value is what you’ll get for the dimensions of each slide. Even more interesting is the fact that the object returned by the JavaScript’s getBoundingClientRect() will show a 0 value for its width property. This is because we’re working with fluid slideshows.

Continue Reading