<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; JS: Слайдер срабатывает один раз]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=10048&amp;type=atom" />
	<updated>2014-10-13T07:39:52Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=10048</id>
		<entry>
			<title type="html"><![CDATA[JS: Слайдер срабатывает один раз]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=87299#p87299" />
			<content type="html"><![CDATA[<p>Здравствуйте есть такой слайдер <a href="http://hostserg.irk0.ru/%20">http://hostserg.irk0.ru/ </a>сейчас работает только кнопка &quot;forward&quot;, я уже над ним долго мучаюсь почти доделал но срабатывает он только один раз не могу разобраться в чем дело вот весь его код</p><div class="codebox"><pre><code>
(function($) {
$.fn.scrollbox = function(config) {
  //default config
  defConfig = {
    step: 50,                // Distance of each single step (in pixels)
    speed: 32,              // Delay after each single step (in milliseconds)
    switchItems: 1,         // Items to switch after each scroll event
    direction: &#039;vertical&#039;,
    distance: &#039;auto&#039;,            
  };
  config = $.extend(defConfig, config);
  config.scrollOffset = config.direction === &#039;vertical&#039; ? &#039;scrollTop&#039; : &#039;scrollLeft&#039;;
  return this.each(function() {
    var container = $(this),
        containerUL,
        nextScrollId = null,
        forward,
        scrollForward,
    containerUL = container.children(&#039;ul:first-child&#039;);
    scrollForward = function() {
                containerUL.children(&#039;li:nth-child(1)&#039;).removeClass(&#039;leftSide&#039;);
                containerUL.children(&#039;li:nth-child(1)&#039;).addClass(&#039;rightSide  &#039;);
                containerUL.children(&#039;li:nth-child(2)&#039;).removeClass(&#039;scale90 leftSide&#039;);
                containerUL.children(&#039;li:nth-child(2)&#039;).addClass(&#039;scale80 leftSide&#039;);
                containerUL.children(&#039;li:nth-child(3)&#039;).removeClass(&#039;scale100&#039;);
                containerUL.children(&#039;li:nth-child(3)&#039;).addClass(&#039;scale90 leftSide&#039;);
                containerUL.children(&#039;li:nth-child(4)&#039;).removeClass(&#039;scale90 rightSide&#039;);
                containerUL.children(&#039;li:nth-child(4)&#039;).addClass(&#039;scale100&#039;);
                containerUL.children(&#039;li:nth-child(5)&#039;).removeClass(&#039;scale80 rightSide&#039;);
                containerUL.children(&#039;li:nth-child(5)&#039;).addClass(&#039;scale90 rightSide&#039;);
    };
    forward = function() {
      scrollingId = setInterval(scrollForward, config.speed);
    };
    // bind events for container
    container.bind(&#039;forward&#039;, function() { clearTimeout(nextScrollId); forward(); });
  });
};
}(jQuery));
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serrrgggeee]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32610</uri>
			</author>
			<updated>2014-10-13T07:39:52Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=87299#p87299</id>
		</entry>
</feed>
