<?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>indexu.com &#187; slider</title>
	<atom:link href="http://www.indexu.com/tag/slider/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indexu.com</link>
	<description>developer blog</description>
	<lastBuildDate>Wed, 30 Jun 2010 05:06:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to make slider work for your template</title>
		<link>http://www.indexu.com/how-to-make-slider-work-for-your-template/</link>
		<comments>http://www.indexu.com/how-to-make-slider-work-for-your-template/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 07:07:20 +0000</pubDate>
		<dc:creator>dody</dc:creator>
				<category><![CDATA[Css]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[slider]]></category>

		<guid isPermaLink="false">http://www.indexu.com/?p=12</guid>
		<description><![CDATA[Indexu use stepcarousel.js for image slider. I realize that the slider need to be customized for each template. Here is some direction how to make it work for any templates you want. 1) Check your header.html file, make sure you have base tag and jquery loaded. Here is my html head section to start: &#60;link [...]]]></description>
			<content:encoded><![CDATA[<p>Indexu use <code>stepcarousel.js</code> for image slider. I realize that the slider need to be customized for each template.<br />
Here is some direction how to make it work for any templates you want.</p>
<p>1) Check your <code>header.html</code> file, make sure you have base tag and jquery loaded. Here is my html head section to start:</p>

<div class="wp_codebox"><table><tr id="p126"><td class="code" id="p12code6"><pre class="html4strict" style="font-family:monospace;">  <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">link</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;%$tpl_base%&gt;</span></span>/jquery.autocomplete.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; charset=&quot;utf-8&quot;&gt;
	<span style="color: #009900;">&lt;%foreach from<span style="color: #66cc66;">=</span>$additional_js key<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name_js&quot;</span> item<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;file_js&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;addition_js&quot;</span>%&gt;</span>
    <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;%$file_js%&gt;</span></span>&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span>
  <span style="color: #009900;">&lt;%<span style="color: #66cc66;">/</span>foreach%&gt;</span>
  <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'&lt;%$tpl_base%&gt;</span></span>/jquery.js'&gt;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span>
  <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'&lt;%$tpl_base%&gt;</span></span>/jquery.autocomplete.min.js'&gt;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
  jQuery(document).ready(function($){
    $(&quot;#keyword&quot;).autocomplete(&quot;<span style="color: #009900;">&lt;%$site_url%&gt;</span>/autocomplete.php?mode=link&quot;);
  });
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span>
&nbsp;
  <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/base.html"><span style="color: #000000; font-weight: bold;">base</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;%$site_url%&gt;</span></span>/&quot; /&gt;</pre></td></tr></table></div>

<p>2) In <code>index.html</code>, call the slider block.</p>

<div class="wp_codebox"><table><tr id="p127"><td class="code" id="p12code7"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;%block_slide max_item<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;20&quot;</span>%&gt;</span></pre></td></tr></table></div>

<p>3) Open <code>/blocks/block.slider.html</code>, notice the slider parameter and there are important html class: <code>slideshow</code> and <code>stepcarousel</code>. Later you will need to set the css width of these class. Also make attention with navigation button (left/right) <code>defaultbuttons</code>, you may want to replace the image and adjust the position.</p>

<div class="wp_codebox"><table><tr id="p128"><td class="code" id="p12code8"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;%if $link%&gt;</span>
    <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;%$tpl_base%&gt;</span></span>/stepcarousel.js&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span>
    <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
&nbsp;
    stepcarousel.setup({
      galleryid: 'mygallery', //id of carousel DIV
      beltclass: 'belt', //class of inner &quot;belt&quot; DIV containing all the panel DIVs
      panelclass: 'panel', //class of panel DIVs each holding content
      autostep: {enable:true, moveby:1, pause:2000},
      panelbehavior: {speed:500, wraparound:true, persist:true},
      defaultbuttons: {enable: true, moveby: 1, leftnav: ['<span style="color: #009900;">&lt;%$tpl_base%&gt;</span>/images/play_l.png', -5, 35], rightnav: ['<span style="color: #009900;">&lt;%$tpl_base%&gt;</span>/images/play_r.png', -20, 35]},
      statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
      contenttype: ['inline'] //content setting ['inline'] or ['ajax', 'path_to_external_file']
    })
&nbsp;
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span>
<span style="color: #009900;">&lt;%$hook_html_block_slide_begin%&gt;</span>
				<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content_box_full slideshow&quot;</span>&gt;</span>
        <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mygallery&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stepcarousel&quot;</span>&gt;</span>
            <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;belt&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;%$link%&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
					<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;clear&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
&nbsp;
&nbsp;
<span style="color: #009900;">&lt;%$hook_html_block_slide_end%&gt;</span>
<span style="color: #009900;">&lt;%<span style="color: #66cc66;">/</span>if%&gt;</span></pre></td></tr></table></div>

<p>4) Open <code>/blocks/block.slider_row.html</code>, you may want to customize something here. In most case, just leave it as it is.</p>

<div class="wp_codebox"><table><tr id="p129"><td class="code" id="p12code9"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;%$hook_html_block_slide_rows_begin%&gt;</span>
&nbsp;
  <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;panel&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;%$site_url%&gt;</span></span>/<span style="color: #009900;">&lt;%$detail_page_url%&gt;</span>&quot; name=&quot;link_<span style="color: #009900;">&lt;%$link_id%&gt;</span>&quot;&gt;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://open.thumbshots.org/image.aspx?url=&lt;%$url%&gt;</span></span>&quot; alt=&quot;<span style="color: #009900;">&lt;%$title%&gt;</span>&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;%$hook_html_block_slide_rows_end%&gt;</span></pre></td></tr></table></div>

<p>5) Now you need to customize the css, you can use main.css, add and adjust the following css code to suit your need. Usually you need to change <code>.slideshow width</code> and <code>.stepcarousel width</code>.</p>

<div class="wp_codebox"><table><tr id="p1210"><td class="code" id="p12code10"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.slideshow</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ddd</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">570px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
.stepcarousel<span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*leave this value alone*/</span>
  <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">scroll</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*leave this value alone*/</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">555px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*Width of Carousel Viewer itself*/</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">115px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*Height should enough to fit largest content's height*/</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.stepcarousel</span> .belt<span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*leave this value alone*/</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.stepcarousel</span> .panel<span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*leave this value alone*/</span>
  <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*clip content that go outside dimensions of holding panel DIV*/</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*margin around each panel*/</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">120px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*Width of each panel holding each content. If removed, widths should be individually defined on each content DIV then. */</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.stepcarousel</span> <span style="color: #6666ff;">.panel</span> img <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>6) Check your template root folder to have needed js files: <code>jquery.js</code> and <code>stepcarousel.js</code>.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.indexu.com/how-to-make-slider-work-for-your-template/&amp;n=How+to+make+slider+work+for+your+template&amp;pli=1" rel="nofollow" class="external" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.indexu.com/how-to-make-slider-work-for-your-template/&amp;title=How+to+make+slider+work+for+your+template" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.indexu.com/how-to-make-slider-work-for-your-template/&amp;t=How+to+make+slider+work+for+your+template" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.indexu.com/how-to-make-slider-work-for-your-template/&amp;title=How+to+make+slider+work+for+your+template" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-squidoo">
			<a href="http://www.squidoo.com/lensmaster/bookmark?http://www.indexu.com/how-to-make-slider-work-for-your-template/" rel="nofollow" class="external" title="Add to a lense on Squidoo">Add to a lense on Squidoo</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+make+slider+work+for+your+template+-+http://b2l.me/y3yD5&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.indexu.com/how-to-make-slider-work-for-your-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

