Creative Use Of jQuery Cycle In Fancy Curved Layout

This article is an effort to answer a layout question posted in CSS-Tricks’ forum. I decided to answer this because it’s also one of the layouts that I have not been accustomed to converting.

Micha posted a link to the layout that needs to be sliced. I checked it out and I really liked it. I’m not sure if Micha wanted the image to be animated but I decided to do just that by using the jQuery Cycle plugin.

Take a look at the final result if you’re interested.

I didn’t convert the said layout, instead I created a basic web site design layout in Photoshop with curves similar to the layout.

Photoshop Layout Design with Fancy Curves

The main thing that you should plan out is where to slice your layout. This is one of the reasons why I think it’s important for a web designer to know how to write HTML and CSS. Knowing HTML and CSS basics will help you to design a layout that can be easily sliced and converted to HTML. You can design a layout in Photoshop with a lot of different methods but the difference will show up when it’s time to slice the design.

Let’s slice the main background graphic.

Main Background Graphic

Then let’s slice up the images we need to cycle. I saved them as a .GIF but you can save them in .PNG if you like because we are after the transparency here.

Transparent image to be sliced

Now let’s see how easy it is to convert this into HTML and CSS

HTML Basic Markup

We only have the main container which will hold up the images and the content.

<div id="container">
	<div id="cycle">
		<img src="image1.gif" width="610" height="522" alt="description of image here" />
		<img src="image2.gif" width="610" height="522" alt="description of image here" />
		<img src="image3.gif" width="610" height="522" alt="description of image here" />
	<div id="content">
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam lectus mauris, pretium sed viverra eu, luctus quis risus. Cras convallis euismod eros, eu varius magna condimentum scelerisque. Vivamus eu tellus justo. Nam urna nisl, aliquet vitae sollicitudin ut, feugiat non est.</p> 
		<p>Aliquam blandit tortor lectus. Cras at nisi consequat dolor suscipit venenatis eget ullamcorper eros. Vivamus nec purus nisi. Integer ut lorem risus, ac feugiat sem. Nam et massa enim, quis dictum purus. Proin tortor dui, laoreet at volutpat eu, pharetra elementum risus. </p>

CSS Basic Styles

We apply a relative position to the container so we can absolutely position the images. Then we just float the content to the right and apply proper paddings on the side.

body {

p {

#container {
	background:transparent url(containerbg.png) no-repeat;
	margin:0 auto;

#cycle {

#content {
	padding:0 20px;

Calling and Initializing jQuery Cycle

Just put this inside the head section and you’ll be up and running.

<script src="" type="text/javascript"></script>
<script src="jquery-cycle-min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	    fx:    'fade', 
	    speed:  3000 


This is basically one quick way to deal with curves and I’m sure you can come up with a lot more creative and unique layouts. This article also shows how you can get creative with the jQuery Cycle plugin. I hope you get something out of this article and I would love to hear your thoughts. Thanks for checking this out.

8 thoughts on “Creative Use Of jQuery Cycle In Fancy Curved Layout

  1. Hi Elena,

    Thanks. You don’t need to upload jQuery to your server. Google will gladly serve it up for you 🙂 But you need to upload the jQuery Cycle plugin to your server.

  2. Thank you Raymond. I have this huge fear of Javascript. So, I always like to know what exactly a document is supposed to contain. I simply loved this tutorial.

  3. Hello it’s me!!! the curve layout trouble girl 😀 thanks for the article i just recently finished the work but i’ve been having some trouble with the live view. maybe you wanna check the whole post here

    It’s kinda weird (and it the problem is no the curves ironic huh :S) it would be great that you stop by and give me some tips please. In the meantime i’m gonna try your method so a better layout.

  4. You could have saved yourself the trouble of having to cut out the main images by simply making a curved header and footer image with a gif or png transparency, and overlaying them over the main content area.

    Just add a margin to the top and bottom of the main content area, and use a position absolute for th header / footer to sit them above the content.

    That way, you can easily change the main image and not have to worry about cutting out a transparent region each time.

    Hope that makes sense!

Leave a Reply

Your email address will not be published. Required fields are marked *