<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Scroll Up Headline Reader</title>
	<atom:link href="http://www.learningjquery.com/2006/10/scroll-up-headline-reader/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader</link>
	<description>Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:50:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Rachit</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-2#comment-86136</link>
		<dc:creator>Rachit</dc:creator>
		<pubDate>Thu, 05 Jan 2012 18:31:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-86136</guid>
		<description>Thankyou for such a great tutorial Karl Sir. ! I am working on to modify this script to work with lists, more like the same above but with multiple links in the box.</description>
		<content:encoded><![CDATA[<p>Thankyou for such a great tutorial Karl Sir. ! I am working on to modify this script to work with lists, more like the same above but with multiple links in the box.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-2#comment-84729</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Tue, 06 Dec 2011 16:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-84729</guid>
		<description>thanks. I fixed the code example.</description>
		<content:encoded><![CDATA[<p>thanks. I fixed the code example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randy</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-1#comment-84667</link>
		<dc:creator>Randy</dc:creator>
		<pubDate>Thu, 10 Nov 2011 08:32:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-84667</guid>
		<description>&lt;code&gt;$(&quot;div.headline:eq(&quot; + current_headline + &quot;)&quot;).css(top, &#039;5px&#039;);&lt;/code&gt;

You are referencing &lt;code&gt;top&lt;/code&gt; as an object, not as a literal. Change to:

&lt;code&gt;$(&quot;div.headline:eq(&quot; + current_headline + &quot;)&quot;).css(&#039;top&#039;, &#039;5px&#039;);&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><code>$("div.headline:eq(" + current_headline + ")").css(top, '5px');</code></p>
<p>You are referencing <code>top</code> as an object, not as a literal. Change to:</p>
<p><code>$("div.headline:eq(" + current_headline + ")").css('top', '5px');</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randy</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-2#comment-84666</link>
		<dc:creator>Randy</dc:creator>
		<pubDate>Thu, 10 Nov 2011 07:16:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-84666</guid>
		<description>Hi Karl,

In the code snippet just above the jQ1.1 .top() deprecation warning

&lt;code&gt;.css(top, &#039;5px&#039;)&lt;/code&gt;

should be

&lt;code&gt;.css(&#039;top&#039;, &#039;5px&#039;)&lt;/code&gt;

Guess I&#039;m the only one that does cut/paste from the snippets instead of the final complete example.

Regards</description>
		<content:encoded><![CDATA[<p>Hi Karl,</p>
<p>In the code snippet just above the jQ1.1 .top() deprecation warning</p>
<p><code>.css(top, '5px')</code></p>
<p>should be</p>
<p><code>.css('top', '5px')</code></p>
<p>Guess I&#8217;m the only one that does cut/paste from the snippets instead of the final complete example.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-2#comment-83378</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Thu, 30 Dec 2010 18:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-83378</guid>
		<description>Did anyone get Markus&#039;s post #17 and Karl&#039;s reply post #18 working?

It works when JS is disabled, all the headlines appear with a vertical scroll bar.   But with JS enabled the first headline is not appearing until the first time through the setInterval time.  

I think is has something to do with css &quot;Top&quot; property, but I&#039;m not 100% sure.  It looks as if it is starting with top set to 320px, which displays nothing.

Code:
#scrollup {position: relative; overflow: auto; height: 320px; }
.headline {position: relative; top: 5px; left: 0; overflow: hidden; height: auto;}

	$(document).ready(function(){
	  headline_count = $(&quot;div.headline&quot;).size();
	  $(&#039;#scrollup&#039;).css({overflow: &#039;hidden&#039;})
	  $(&#039;div.headline&#039;)
	  .css({position: &#039;absolute&#039;, height: &#039;320px&#039;})
	    .not(current_headline)
	    .css(&#039;top&#039;,&#039;320px&#039;);	  
	  headline_interval = setInterval(headline_rotate,2000);
	});
	
	function headline_rotate() {
	  current_headline = (old_headline + 1) % headline_count;
	  $(&quot;div.headline:eq(&quot; + old_headline + &quot;)&quot;)
	  .animate({top: -325},&quot;slow&quot;, function() {
	   $(this).css(&#039;top&#039;, &#039;330px&#039;);
	 });
	  $(&quot;div.headline:eq(&quot; + current_headline + &quot;)&quot;)
	  .animate({top: 5},&quot;slow&quot;);
	  old_headline = current_headline;
	}</description>
		<content:encoded><![CDATA[<p>Did anyone get Markus&#8217;s post #17 and Karl&#8217;s reply post #18 working?</p>
<p>It works when JS is disabled, all the headlines appear with a vertical scroll bar.   But with JS enabled the first headline is not appearing until the first time through the setInterval time.  </p>
<p>I think is has something to do with css &#8220;Top&#8221; property, but I&#8217;m not 100% sure.  It looks as if it is starting with top set to 320px, which displays nothing.</p>
<p>Code:<br />
#scrollup {position: relative; overflow: auto; height: 320px; }<br />
.headline {position: relative; top: 5px; left: 0; overflow: hidden; height: auto;}</p>
<p>	$(document).ready(function(){<br />
	  headline_count = $(&#8220;div.headline&#8221;).size();<br />
	  $(&#8216;#scrollup&#8217;).css({overflow: &#8216;hidden&#8217;})<br />
	  $(&#8216;div.headline&#8217;)<br />
	  .css({position: &#8216;absolute&#8217;, height: &#8217;320px&#8217;})<br />
	    .not(current_headline)<br />
	    .css(&#8216;top&#8217;,&#8217;320px&#8217;);<br />
	  headline_interval = setInterval(headline_rotate,2000);<br />
	});</p>
<p>	function headline_rotate() {<br />
	  current_headline = (old_headline + 1) % headline_count;<br />
	  $(&#8220;div.headline:eq(&#8221; + old_headline + &#8220;)&#8221;)<br />
	  .animate({top: -325},&#8221;slow&#8221;, function() {<br />
	   $(this).css(&#8216;top&#8217;, &#8217;330px&#8217;);<br />
	 });<br />
	  $(&#8220;div.headline:eq(&#8221; + current_headline + &#8220;)&#8221;)<br />
	  .animate({top: 5},&#8221;slow&#8221;);<br />
	  old_headline = current_headline;<br />
	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: txmod</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-1#comment-83115</link>
		<dc:creator>txmod</dc:creator>
		<pubDate>Mon, 15 Nov 2010 13:33:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-83115</guid>
		<description>If I want to use the same function for other boxes on the same page, how do I add a different id in the script? Otherwise I should load different scripts and css for each box. I used a method, but does not work. Can you tell me how to improve the script suggesting this?
&lt;pre&gt;&lt;code&gt;
headlineId = $(this).attr(&#039;class&#039;);
headline_count = $(&quot;div.&quot;+headlineId+&quot;_hl&quot;).size();

otherwise

headlineId = $(this).attr(&#039;id&#039;);
headline_count = $(&quot;#&quot;+headlineId+&quot;_hl&quot;).size();
&lt;/code&gt;&lt;/pre&gt;

Thanks</description>
		<content:encoded><![CDATA[<p>If I want to use the same function for other boxes on the same page, how do I add a different id in the script? Otherwise I should load different scripts and css for each box. I used a method, but does not work. Can you tell me how to improve the script suggesting this?</p>
<pre><code>
headlineId = $(this).attr('class');
headline_count = $("div."+headlineId+"_hl").size();

otherwise

headlineId = $(this).attr('id');
headline_count = $("#"+headlineId+"_hl").size();
</code></pre>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SMS</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-1#comment-83046</link>
		<dc:creator>SMS</dc:creator>
		<pubDate>Mon, 08 Nov 2010 21:36:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-83046</guid>
		<description>In FF I moved the mouse pointer in and out of the box real fast several times...interesting results.  You shouldn&#039;t have to care about people being careless like that, but you could probably easily code a fix to prevent it.</description>
		<content:encoded><![CDATA[<p>In FF I moved the mouse pointer in and out of the box real fast several times&#8230;interesting results.  You shouldn&#8217;t have to care about people being careless like that, but you could probably easily code a fix to prevent it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JQuery &#8211; Scroll up Headline Display &#171; A September Chill&#8230;</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-1#comment-82793</link>
		<dc:creator>JQuery &#8211; Scroll up Headline Display &#171; A September Chill&#8230;</dc:creator>
		<pubDate>Mon, 18 Oct 2010 20:01:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-82793</guid>
		<description>[...] A really simple newsfeed scrolling display – at time of writing only displays one item at a time, but the author intends to write a multi-item display version before long: http://www.learningjquery.com/2006/10/scroll-up-headline-reader [...]</description>
		<content:encoded><![CDATA[<p>[...] A really simple newsfeed scrolling display – at time of writing only displays one item at a time, but the author intends to write a multi-item display version before long: <a href="http://www.learningjquery.com/2006/10/scroll-up-headline-reader" rel="nofollow">http://www.learningjquery.com/2006/10/scroll-up-headline-reader</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-1#comment-81916</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Sun, 26 Sep 2010 18:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-81916</guid>
		<description>In the code above, the headline_interval variable is assigned to a setInterval function. That setInterval function executes the headline_rotate function every 5000 milliseconds (or 5 seconds):

&lt;code&gt;headline_interval = setInterval(headline_rotate,5000);&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>In the code above, the headline_interval variable is assigned to a setInterval function. That setInterval function executes the headline_rotate function every 5000 milliseconds (or 5 seconds):</p>
<p><code>headline_interval = setInterval(headline_rotate,5000);</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Ivaylov</title>
		<link>http://www.learningjquery.com/2006/10/scroll-up-headline-reader/comment-page-1#comment-81907</link>
		<dc:creator>Stephan Ivaylov</dc:creator>
		<pubDate>Fri, 24 Sep 2010 08:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2006/10/scroll-up-headline-reader#comment-81907</guid>
		<description>Hi Karl,

I really can&#039;t get which part of the code is in charge for the cycling?
I mean all this functions to be called again for every iteration.
Is it only the &quot;setTimeout()&quot; method responsible?</description>
		<content:encoded><![CDATA[<p>Hi Karl,</p>
<p>I really can&#8217;t get which part of the code is in charge for the cycling?<br />
I mean all this functions to be called again for every iteration.<br />
Is it only the &#8220;setTimeout()&#8221; method responsible?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 9/21 queries in 0.007 seconds using disk: basic
Object Caching 372/379 objects using disk: basic
Content Delivery Network via learningjquery.kswedberg.netdna-cdn.com

Served from: www.learningjquery.com @ 2012-02-08 14:24:36 -->
