Nathan Colgate RSS

This is the personal blog of Nathan Colgate Clark. I work at Brand New Box. I developed a content management system for churches.

Archive

Apr
16th
Thu
permalink

jQuery Cycle Different Effects for Previous and Next

jQuery Cycle plugin is fantastic.  However, there is a little bit of inconsistantcy when using it as a left/right slideshow.  You click the next arrow, it goes right. You click the previous arrow, it goes left right.  The following code allows you to have different effects based on previous/ next button clicks.

Demo

jQuery(document).ready(function(){




		$('#blink_headlines').cycle({ 

	    fx:      	'scrollBothWays',

			next:   	'#cycle_next_blue',

			prev: 		'#cycle_prev_blue',

	    speed:  	1000,

	    timeout: 	0,

			pause:   	1,

			easeIn:   'easeOutBack',

			easeOut:  'easeOutBack'

		});

});





$.fn.cycle.transitions.scrollBothWays = function($cont, $slides, opts) {

	$cont.css('overflow','hidden');

	opts.before.push($.fn.cycle.commonReset);



	// custom transition fn (trying to get it to scroll forward and backward)

	opts.fxFn = function(curr, next, opts, cb, fwd) {

		

		var w = $cont.width();

		opts.cssFirst = { left: 0 };

		opts.animIn	  = { left: 0 };

		

		if(fwd){

			opts.cssBefore= { left: w, top: 0 };

			opts.animOut  = { left: 0-w };

		}else{

			opts.cssBefore= { left: -w, top: 0 };

			opts.animOut  = { left: w };

		};

		

		var $l = $(curr), $n = $(next);

		var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut, animOut = opts.animOut, animIn = opts.animIn;

		$n.css(opts.cssBefore);

		var fn = function() {$n.show();$n.animate(animIn, speedIn, easeIn, cb);};

		$l.animate(animOut, speedOut, easeOut, function() {

			if (opts.cssAfter) $l.css(opts.cssAfter);

			if (!opts.sync) fn();

		});

		if (opts.sync) fn();

	};

};
Jan
21st
Wed
permalink

My Dreams Concern Me

  • Nathan: Why are you here?
  • German1: We're looking for Marius Deboucher.
  • Nathan: Who?
  • German2: Marius Deboucher. You know. The chess player.
  • Nathan: ...
  • German1: Marius Deboucher, the greatest offensive castling chess player in the world!
  • Nathan: I'm afraid not.
  • German1 and German2: (singing a jingle) "Knight to check. Rook to Queen's pawn six. Checkmate. You've been Marius Debouched!"
  • Nathan: ...
Dec
10th
Wed
permalink
Nov
14th
Fri
permalink

TinyMCE ImageManager and Symbolic Links

Solved:

If using capistrano and you have a symlinked shared directory which exists between deployments.
set preview.wwwroot to /var/www/apps/application/shared/
and filesystem.rootpath to /var/www/apps/application/shared/system

(assuming you want to save files in system).

This avoids the symlinks and allows tinymce to translate the paths properly.

-via pyrat

Oct
7th
Tue
permalink
Oct
1st
Wed
permalink

Continuing my YouTube dedications: This one is for Allie and for all of the hundreds (if not thousands) of hours we spent in our neighborhood pool in Valencia dreaming of working with dolphins at Sea World.  She’s now a teacher and I make websites.

We messed up.

Sep
29th
Mon
permalink

This is for Sarah, who loves good music and sitting on the couch with me. via Grammy

Sep
15th
Mon
permalink

Tears are rolling down my face in Torrey Pines.

Sep
10th
Wed
permalink
Multispectral vision.  Matt and I had a good talk about this on the way home last night.  Our question: if we saw things in different waves (i.e. what if we saw radio waves), would things appear at a lower resolution.

Multispectral vision.  Matt and I had a good talk about this on the way home last night.  Our question: if we saw things in different waves (i.e. what if we saw radio waves), would things appear at a lower resolution.

Aug
18th
Mon
permalink
We think that City Gates, one of our Rails applications, might have sprung a little memory leak… something to the tune of 5MB/hour.  In an effor to remedy this, I’ve been using Scott Lairds MemoryProfiler.  And being the visual guy I am, I wanted more visually appealling data to look at (if I’m going to have to trouble shoot something as nasty as this, it might as well look nice).
So I wrote a simple flex application that parses the log file into a pretty graph.

We think that City Gates, one of our Rails applications, might have sprung a little memory leak… something to the tune of 5MB/hour. In an effor to remedy this, I’ve been using Scott Lairds MemoryProfiler. And being the visual guy I am, I wanted more visually appealling data to look at (if I’m going to have to trouble shoot something as nasty as this, it might as well look nice).

So I wrote a simple flex application that parses the log file into a pretty graph.