There are two flavours of each(). It can be used as selector to grab ‘each’ instance of a selector or it can be used to loop around objects like arrays. Usage 1: Looping Elements in the HTML We can use each() as a Selector. Assume we have a simple list: Then with each() we can…
Read MoreWith the likes of jQuery you often have the need to create callback functions. These can be anonymous / inline or named functions. Here is quick post to show the syntax differences between the two. Anonymous Here is an anonymous or if you prefer inline function. The function isn’t named and we get straight into…
Read MoreShould I Split or Should I Join Now or Should I Array I Should I Go Now. Oh dear. Shoehorning the Clash to a Javascript tutorial – phew rock ‘n’ roll. Arrays are a neat way of moving and manipulating data. To create an array in Javascript the syntax is as follows: Or if you…
Read MoreMoving beyond HTML, Class and ID selector there are some more CSS tools in the CSS toolkit. These selectors are part of the CSS2 specification. None of your fancy CSS3 here, so you can be assured of good browser support. Relational Selectors Relational Selectors allow the designer to target content based on the relation of…
Read MoreMany web applications require the developer to add data, if none is there, but amend data if some exists. Take the example of an online survey. The user answers a question, and in our SQL we use INSERT to add the data to MySQL. The first time a record is added we could use ‘auto-increment’…
Read MoreConcatenation – such a wonderful word to say. Also a real get out of jail card when manipulating data in your MySQL database. Take a scenario where you want to create a ‘fullname’ field from a ‘firstname’ and ‘surname’ field. This can be achieved with the CONCAT command. The syntax is A SQL SELECT statement…
Read MoreIt is getting to that time of year again. Digging around in the attic I found an old-fashion Flash/Actionscript snow storm. Oh Happy days … but as it is 2011 what we really need is a HTML5 snowstorm. http://www.mustbebuilt.co.uk/demo/html5/canvas-snow.html Here is breakdown of the code. First you need a canvas. To use this canvas element…
Read MoreProject after project connecting to databases. What I need is a cheatsheet for the PHP MySQLi extension to cover the most common querying scenarios. Here we go: Give me one record Give me the whole lot One row from user input using prepare When you have variables coming via $_POST or $_GET ($_GET in this…
Read MoreAdobe Edge, available in beta, is a ‘post Flash’ animation tool. It generates animations constructed with web standards HTML5, CSS3 and Javascript (mainly piggy backing on jQuery). The interface is very familiar to Adobe After Effects in terms of the timeline and property keyframes. In terms of functionality it has the lightweight options for adding…
Read MoreIn this post I’ll talk you through the basics of creating a Photoshop Comp and taking it throught to Flash to animate. Creating the Photoshop Composition We are going to create a Photoshop composition ‘comp’ that we will import into Adobe Flash Professional to animate. We are doing to produce an image of a windfarm.…
Read More