<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>ProDevTips - Latest Comments in jQuery - making scrolling and toggling simple</title><link>http://prodevtips.disqus.com/</link><description>Mainly tutorials and tips relating to web development with PHP, Javascript, jQuery and Ruby</description><language>en</language><lastBuildDate>Wed, 12 Dec 2007 13:32:24 -0000</lastBuildDate><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494285</link><description>How about a demo about 'load on scroll' or 'pageless scrolling' &lt;br&gt;&lt;br&gt;example at &lt;a href="http://www.dzone.com" rel="nofollow"&gt;www.dzone.com&lt;/a&gt; and just try to scroll down on the page. pretty neat!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bhaarat</dc:creator><pubDate>Wed, 12 Dec 2007 13:32:24 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494284</link><description>Oops.. I mean '.' + klass. Not '#' + klass.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ariel Flesler</dc:creator><pubDate>Fri, 07 Dec 2007 07:48:47 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494283</link><description>@dave&lt;br&gt;  If you use hasClass, you must remove the dot leading the className. As for speed.. that is odd, because if you take a look at hasClass:&lt;br&gt;&lt;br&gt;hasClass: function(expr) {&lt;br&gt;	return this.is("." + expr);&lt;br&gt;},&lt;br&gt;&lt;br&gt;It's doing, internally, the same as I did. I don't think it can be really faster. hasClass is useful when you have the className in a variable, so it saves you the  '#' + klass .</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ariel Flesler</dc:creator><pubDate>Fri, 07 Dec 2007 07:47:52 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494282</link><description>Thanks Dave!&lt;br&gt;&lt;br&gt;Rich: I will link to that whole project when it is finished. In the meantime what we do here is simply making the main browser window scroll to make the element clicked centered vertically. The purpose is to enhance the usability of the interface.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">prodevtips</dc:creator><pubDate>Fri, 07 Dec 2007 02:19:23 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494281</link><description>Can you post a demo of effect you are doing? &lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Rich</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rich</dc:creator><pubDate>Thu, 06 Dec 2007 15:47:09 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494279</link><description>If you're using jQuery 1.2.1, you can use the hasClass() method instead of is() so you could re-write part of Ariel's code from:&lt;br&gt;&lt;br&gt; !$el.is(’.hidden_simple')&lt;br&gt;&lt;br&gt;to &lt;br&gt;&lt;br&gt; !$el.hasClass(’.hidden_simple')&lt;br&gt;&lt;br&gt;I ran a few very basic speed tests and found the hasClass() method to be about 30% faster.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dave mcfarland</dc:creator><pubDate>Thu, 06 Dec 2007 12:11:47 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494278</link><description>I think the problem was that I looked to dimensions before I found scrollto ,therefore I knew I could get the position of an element with dimensions and that made me not review your stuff like I should have it seems. I think everything is clear enough, thanks for an awesome plugin!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">prodevtips</dc:creator><pubDate>Thu, 06 Dec 2007 09:05:47 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494280</link><description>Indeed.. since the... third release, more or less. The plugin stopped relying on dimensions. &lt;br&gt;If you are interested, that function could be shorter written like this:&lt;br&gt;&lt;br&gt;function toggleViz(el_id){&lt;br&gt;	var $el = $("#"+el_id).toggleClass("hidden_simple");&lt;br&gt;	if ( !$el.is('.hidden_simple') )&lt;br&gt;		$.scrollTo( $el, {speed:500});&lt;br&gt;};&lt;br&gt;&lt;br&gt;I do admit the examples don't show all the possible uses of the plugin. But the source code has some more examples and explains each customizable option too.&lt;br&gt;Please let me know, if you think it's not clear enough, thanks.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ariel Flesler</dc:creator><pubDate>Thu, 06 Dec 2007 08:08:47 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494275</link><description>Awesome Ariel, I didn't see that one in your example (didn't look very hard though). So I suppose we can throw out the dimension plugin in this example.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">prodevtips</dc:creator><pubDate>Wed, 05 Dec 2007 23:37:20 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494277</link><description>The &lt;code&gt;&amp;lt;a href="javascript:toggleViz('{$feed.id}')" rel="nofollow"&amp;gt;more&lt;/a&gt;&lt;/code&gt; stuff could probably be implemented with some kind of callback event functionality. It's on my to do list.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">prodevtips</dc:creator><pubDate>Wed, 05 Dec 2007 22:55:09 -0000</pubDate></item><item><title>Re: jQuery - making scrolling and toggling simple</title><link>http://www.prodevtips.com/2007/12/05/jquery-making-scrolling-and-toggling-simple/#comment-1494276</link><description>Hi, doesn't this work as expected ?&lt;br&gt;&lt;br&gt;function toggleViz(el_id){&lt;br&gt;	$("#"+el_id).toggleClass("hidden_simple");&lt;br&gt;	if($("#"+el_id).attr("className") != "hidden_simple"){&lt;br&gt;                // see the modification here V&lt;br&gt;		$.scrollTo( "#"+el_id, {speed:500});&lt;br&gt;	}&lt;br&gt;}</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ariel Flesler</dc:creator><pubDate>Wed, 05 Dec 2007 09:03:02 -0000</pubDate></item></channel></rss>