<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Thinkubator - A Thoughtprocess Interactive Blog &#187; Programming</title>
	<atom:link href="http://www.thoughtprocessinteractive.com/blog/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.thoughtprocessinteractive.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 12 Apr 2010 15:07:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Combining navigation on the easySlider jQuery plugin</title>
		<link>http://www.thoughtprocessinteractive.com/blog/combining-navigation-on-the-easyslider-jquery-plugin</link>
		<comments>http://www.thoughtprocessinteractive.com/blog/combining-navigation-on-the-easyslider-jquery-plugin#comments</comments>
		<pubDate>Wed, 23 Dec 2009 23:34:01 +0000</pubDate>
		<dc:creator>Stephanie</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Stephanie Raumschuh]]></category>
		<category><![CDATA[What Were They Thinkubating?!]]></category>
		<category><![CDATA[easyslider]]></category>
		<category><![CDATA[jquery slider]]></category>

		<guid isPermaLink="false">http://www.thoughtprocessinteractive.com/blog/?p=508</guid>
		<description><![CDATA[Today, I was putting together a proof-of-concept for a new website design that included a media &#8217;slider&#8217; on the home page. I did a bit of searching and came across the Easy Slider 1.7 plugin which uses jQuery to simplify this task. Score! We love jQuery here at TPI because it takes heavy-coding Javascript tasks [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I was putting together a proof-of-concept for a new website design that included a media &#8217;slider&#8217; on the home page. I did a bit of searching and came across the <a href="http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider" target="_blank">Easy Slider 1.7</a> plugin which uses <a href="http://jquery.com/" target="_blank">jQuery</a> to simplify this task. Score! We love jQuery here at TPI because it takes heavy-coding Javascript tasks and makes them really simple to accomplish and usually more interactive and fun.</p>
<p>This plugin seemed to have all we needed except one thing. There was a choice in navigation between arrows left and right (previous and next) OR numeric/individual item navigation below. (For this case, we&#8217;ll use actual &#8216;Sliders&#8217; as our representation of the easySlider. Hungry yet?)</p>
<p><img class=" alignnone" title="Sliders" src="http://www.tpidev.com/tpi/sliders/images/blogslider.jpg" alt="Navigation illustration" width="500" height="328" /></p>
<p>For the design we&#8217;re envisioning, both systems needed to be utilized. It seemed like a simple fix and I set about combining both  navigation types to show up at the same time. Problem. For some reason, the next/previous buttons weren&#8217;t behaving properly when you used the numeric navigation below to choose an item! If you clicked on an item in the numeric nav, the next button would inexplicably send the gallery zooming off into space and then slowly return to the first item in the list.</p>
<p>How do we fix this!? Good ol&#8217; scheming and know-how to the rescue! I&#8217;ll give you the quick-and-dirty since I&#8217;m pretty sure that&#8217;s what you&#8217;re interested in, anyway.</p>
<p>First, to show both navigations, go into easySlider1.7.js and find this part:</p>
<pre style="overflow:scroll">if(options.controlsShow){
var html = options.controlsBefore;
if(options.numeric){
html += '&lt;ol id="'+ options.numericId +'"&gt;&lt;/ol&gt;';
} else {
if(options.firstShow) html += '&lt;span id="'+ options.firstId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.firstText +'&lt;/a&gt;&lt;/span&gt;';
html += ' &lt;span id="'+ options.prevId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.prevText +'&lt;/a&gt;&lt;/span&gt;';
html += ' &lt;span id="'+ options.nextId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.nextText +'&lt;/a&gt;&lt;/span&gt;';
if(options.lastShow) html += ' &lt;span id="'+ options.lastId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.lastText +'&lt;/a&gt;&lt;/span&gt;';
};

html += options.controlsAfter;
$(obj).after(html);
};</pre>
<p>And change it to this:</p>
<pre style="overflow:scroll">if(options.controlsShow){
var html = options.controlsBefore;
if(options.numeric){
html += '&lt;ol id="'+ options.numericId +'"&gt;&lt;/ol&gt;';
if(options.firstShow) html += '&lt;span id="'+ options.firstId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.firstText +'&lt;/a&gt;&lt;/span&gt;';
html += ' &lt;div id="arrows"&gt;&lt;span id="'+ options.prevId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.prevText +'&lt;/a&gt;&lt;/span&gt;';
html += ' &lt;span id="'+ options.nextId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.nextText +'&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;';
if(options.lastShow) html += ' &lt;span id="'+ options.lastId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.lastText +'&lt;/a&gt;&lt;/span&gt;';
} else {
if(options.firstShow) html += '&lt;span id="'+ options.firstId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.firstText +'&lt;/a&gt;&lt;/span&gt;';
html += ' &lt;span id="'+ options.prevId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.prevText +'&lt;/a&gt;&lt;/span&gt;';
html += ' &lt;span id="'+ options.nextId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.nextText +'&lt;/a&gt;&lt;/span&gt;';
if(options.lastShow) html += ' &lt;span id="'+ options.lastId +'"&gt;&lt;a href=\"javascript:void(0);\"&gt;'+ options.lastText +'&lt;/a&gt;&lt;/span&gt;';
};

html += options.controlsAfter;
$(obj).after(html);
};</pre>
<p>Then find this part:</p>
<pre>if(options.numeric){
for(var i=0;i&lt;s;i++){
$(document.createElement("li"))
.attr('id',options.numericId + (i+1))
.html('&lt;a rel='+ i +' href=\"javascript:void(0);\"&gt;'+ (i+1) +'&lt;/a&gt;')
.appendTo($("#"+ options.numericId))
.click(function(){
animate($("a",$(this)).attr('rel'),true);
});
};
} else {
$("a","#"+options.nextId).click(function(){
animate("next",true);
});
$("a","#"+options.prevId).click(function(){
animate("prev",true);
});
$("a","#"+options.firstId).click(function(){
animate("first",true);
});
$("a","#"+options.lastId).click(function(){
animate("last",true);
});
};</pre>
<p>And change it to this:</p>
<pre style="overflow:scroll">if(options.numeric){
for(var i=0;i&lt;s;i++){
$(document.createElement("li"))
.attr('id',options.numericId + (i+1))
.html('&lt;a rel='+ i +' href=\"javascript:void(0);\"&gt;'+ (i+1) +'&lt;/a&gt;')
.appendTo($("#"+ options.numericId))
.click(function(){
animate($("a",$(this)).attr('rel'),true);
});
};
$("a","#"+options.nextId).click(function(){
animate("next",true);
});
$("a","#"+options.prevId).click(function(){
animate("prev",true);
});
$("a","#"+options.firstId).click(function(){
animate("first",true);
});
$("a","#"+options.lastId).click(function(){
animate("last",true);
});
} else {
$("a","#"+options.nextId).click(function(){
animate("next",true);
});
$("a","#"+options.prevId).click(function(){
animate("prev",true);
});
$("a","#"+options.firstId).click(function(){
animate("first",true);
});
$("a","#"+options.lastId).click(function(){
animate("last",true);
});
};</pre>
<p>NOW, to make it work properly (and here&#8217;s the kicker), parseInt!!!!!</p>
<p>Find the &#8216;animate&#8217; function (~line 140):</p>
<pre style="overflow:scroll">function animate(dir,clicked){
if (clickable){
clickable = false;
var ot = t;
switch(dir){
case "next":
t = (ot&gt;=ts) ? (options.continuous ? t+1 : ts) : t+1;
break;
case "prev":
t = (t&lt;=0) ? (options.continuous ? t-1 : 0) : t-1;
break;
case "first":
t = 0;
break;
case "last":
t = ts;
break;
default:
t = dir;
break;
};</pre>
<p>And insert this itttty bitty little parseInt:</p>
<pre style="overflow:scroll">function animate(dir,clicked){
if (clickable){
clickable = false;
var ot = t;
t = parseInt(t);
switch(dir){
case "next":
t = (ot&gt;=ts) ? (options.continuous ? t+1 : ts) : t+1;
break;
case "prev":
t = (t&lt;=0) ? (options.continuous ? t-1 : 0) : t-1;
break;
case "first":
t = 0;
break;
case "last":
t = ts;
break;
default:
t = dir;
break;
};</pre>
<p>Thats it! Wow, that seemed a lot harder than it was. We figured out that the two navigations were treating the current item differently (one as an integer, one as a string &#8211; who knew!) so basically we&#8217;re just telling them all to be integers so both methods will work the same.</p>
<p>For reference, here&#8217;s another little proof of concept we drew up. Sliders. Get it? We&#8217;re hilarious, i know.  (click the pickles OR the ketchup. CRAZY!) <a href="http://tpidev.com/tpi/sliders/index.html" target="_blank">easySlider plugin &#8216;Sliders&#8217; demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtprocessinteractive.com/blog/combining-navigation-on-the-easyslider-jquery-plugin/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Play .mp4 Videos in the Shadowbox FLV Player</title>
		<link>http://www.thoughtprocessinteractive.com/blog/play-mp4-videos-in-the-shadowbox-flv-player</link>
		<comments>http://www.thoughtprocessinteractive.com/blog/play-mp4-videos-in-the-shadowbox-flv-player#comments</comments>
		<pubDate>Thu, 03 Dec 2009 14:57:13 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[JW Player]]></category>
		<category><![CDATA[Shadowbox]]></category>

		<guid isPermaLink="false">http://www.thoughtprocessinteractive.com/blog/?p=495</guid>
		<description><![CDATA[Here at TPI, we love Shadowbox. It is a very clean and simple way of displaying a photo gallery or playing a video on a website. To play a .mp4 video on a site, you would normally initiate the Shadowbox player like this:
&#60;script type="text/javascript&#62;
     Shadowbox.init({
       [...]]]></description>
			<content:encoded><![CDATA[<p>Here at TPI, we love <a title="Shadowbox" href="http://www.shadowbox-js.com/" target="_self">Shadowbox</a>. It is a very clean and simple way of displaying a photo gallery or playing a video on a website. To play a .mp4 video on a site, you would normally initiate the Shadowbox player like this:</p>
<pre>&lt;script type="text/javascript&gt;
     Shadowbox.init({
          players: ["img", "qt"]
     });
&lt;/script&gt;</pre>
<p>And then use an anchor to make the image or text clickable like this:</p>
<pre>&lt;a rel="shadowbox" href="my_video.mp4" title="My Video Title"&gt;
     Watch The Video
&lt;/a&gt;</pre>
<p>This works, but it relies on the fact that the clients browser has the quicktime plugin installed. Some of you already know that the Flash player can play .mp4 video files. The Flash plugin is installed on almost all browsers, so it would be ideal if the .mp4 videos would play in the Shadowbox <a title="JW Player" href="http://www.longtailvideo.com/" target="_self">JW Player</a> instead.</p>
<p>Lucky for us, Shadowbox has an option that lets you decide what extensions work with which players. In this case, we want .mp4 videos to use the &#8220;flv&#8221; player rather than the &#8220;qt&#8221; player. Here&#8217;s how you do it:</p>
<pre>&lt;script type="text/javascript"&gt;
     var customExt = {
          img:["png","jpg","jpeg","gif","bmp"],
          swf:["swf"],
          flv:["flv", "mp4"],
          qt:["dv","mov","moov","movie"],
          wmp:["asf","wm","wmv"],
          qtwmp:["avi","mpg","mpeg"],
          iframe:["asp","aspx","cgi","cfm","htm","html",
                  "jsp","pl","php","php3","php4","php5",
                  "phtml","rb","rhtml","shtml","txt","vbs"]
     };
     Shadowbox.init({
          players: ["img", "flv"],
          ext: customExt
     });
&lt;/script&gt;</pre>
<p>Normally, the &#8220;qt&#8221; player plays all &#8220;.mp4&#8243; files. Simply move the &#8220;mp4&#8243; extension to the &#8220;flv&#8221; property. Using this method, you can decide which extensions use which players in Shadowbox.</p>
<p>Now, when a user clicks the Shadowbox link, the .mp4 video uses the &#8220;flv&#8221; player and plays in the JW Player:</p>
<pre>&lt;a rel="shadowbox" href="my_video.mp4" title="My Video Title"&gt;
     Watch the .mp4 video in the JW Player.
&lt;/a&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtprocessinteractive.com/blog/play-mp4-videos-in-the-shadowbox-flv-player/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
