Flip Flop

01 Dec 2003

A few folks have asked me how I created the alternating background colours in the comments sections. I use a Movable Type plug-in called ‘Flip Flop’, written by a chap called Gavin Estey. I’d been wanting to use this for a while, and finally got around to implementing it.

All you need to do is create the 2 alternating styles (an odd and an even) in your css, and then put the following code into your MT template. In this simplified example, I’ve used ‘green’ and ‘white’ as my 2 options.

CSS:

/* MT Flip Flop styles */
.green {
	padding: 8px;
	background: #EEF7DD;
}
.white {
	padding: 8px;
	background: #fff;
}

Movable Type:


<MTComments>
<div class="<$MTFlipFlop odd="green" even="white"$>">
<$MTCommentBody$>
</div>
</MTComments>

The Flip Flop plug-in then decides which style it needs to use. Thanks Gavin!

Recent Posts

New Identity for iHasco

13 Nov 2018

Leigh and Jon did Inktober

01 Nov 2018

We are Oxvik

15 Oct 2018

The Hicks Logowall

05 Oct 2018

Hiding Away

16 Sep 2018

Biro sketch of Lauzerte

23 Aug 2018

Firefox Identity Project

21 Aug 2018

It’s just fashion

26 Jun 2018

The Symbol Sourcebook

08 Jun 2018

Instagram Hickstagram

  • 08 Dec 2018

    More Red-crested Pochard

  • 08 Dec 2018

    Wigeon + Red Crested Pochard

  • 05 Dec 2018

    A small glimmer of light on a very dark day.

  • 29 Nov 2018

    View from the office. To the left, and to the right…

  • 25 Nov 2018

    Gorgeous pre-gig food at Turtle Bay

  • 25 Nov 2018

    Lego Noddy Holder!

  • 18 Nov 2018

  • 18 Nov 2018

  • 11 Nov 2018

    It’s got to the PowerPoint presentation part of Gruff Rhys’ set.

  • 11 Nov 2018

Contact us

Call Jon on +44 (0)7917 391536, email or tweet @hicksdesign.

Alternatively, pop in for tea and cake at the studio…

Hicks
Wenrisc House
Meadow Court
Witney, OX28 6ER
United Kingdom