Time for action – creating the UI

Next we need to create the previous and next links that are overlaid above the images and allow the visitor to cycle through the images:

$.tranzify.createUI = function(config) { var imgLength = $(config.selector).find("img").length, prevA = $("<a></a>", { id: config.prevID, href: "#", html: "&laquo;", click: function(e) { e.preventDefault(); $(config.selector).find("a").css("display", "none"); $.tranzify.createOverlay(config); var currImg = $("." + config.visibleClass, $(config.selector)); if(currImg.prev().filter("img").length > 0) { currImg.removeClass(config.visibleClass).prev().addClass(config.visibleClass); } else { currImg.removeClass(config.visibleClass); $(config.selector).find("img").eq(imgLength - 1).addClass(config.visibleClass); ...

Get jQuery 1.4 Animation Techniques Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.