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

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

Differences between Icon and Logo Design on This is HCD Podcast

10 Apr 2018

Twelve South PencilSnap

01 Apr 2018

The Infinite Canvas

09 Feb 2018

Blade Runner 2049

14 Oct 2017

Instagram Hickstagram

  • 14 Sep 2018

    When horses dress up as cows

  • 07 Sep 2018

    Olive’s feeling autumnal

  • 06 Sep 2018

    Going, going …

  • 27 Aug 2018

    Day out MTBing in the Forest of Dean. Bloody knackering climbs and exciting downhills - woohoo!!

  • 23 Aug 2018

    Interesting cloud formations tonight. The whole sky had parallel lines

  • 14 Aug 2018

  • 14 Aug 2018

    Everything’s going to be OK!

  • 14 Aug 2018

  • 12 Aug 2018

    Curry wurst, at last!

  • 12 Aug 2018

    Wheels new and old

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