<?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: JQuery Flicker in Firefox</title>
	<atom:link href="http://www.adrogen.com/blog/jquery-flicker-in-firefox/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/</link>
	<description>our thoughts online</description>
	<lastBuildDate>Tue, 20 Jul 2010 00:04:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Michael</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-4040</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 06 Jul 2010 17:55:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-4040</guid>
		<description>YOU ARE THE MAN!!!!! Ive been going bazonkers over this forever.</description>
		<content:encoded><![CDATA[<p>YOU ARE THE MAN!!!!! Ive been going bazonkers over this forever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pradeep Gaur</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-3387</link>
		<dc:creator>Pradeep Gaur</dc:creator>
		<pubDate>Tue, 11 May 2010 05:36:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-3387</guid>
		<description>hey
That&#039;s great solution. i wasted my more then 3 hours to solve that problem i used event.preventDefault() but that&#039;s not work but your solution is magic and working great.
Keep it up this kind of programing
thankx a lot.</description>
		<content:encoded><![CDATA[<p>hey<br />
That&#8217;s great solution. i wasted my more then 3 hours to solve that problem i used event.preventDefault() but that&#8217;s not work but your solution is magic and working great.<br />
Keep it up this kind of programing<br />
thankx a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-3060</link>
		<dc:creator>Will</dc:creator>
		<pubDate>Tue, 06 Apr 2010 23:04:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-3060</guid>
		<description>Thank you so much! I would have never figured that out without your help, the day is saved!!!</description>
		<content:encoded><![CDATA[<p>Thank you so much! I would have never figured that out without your help, the day is saved!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-2493</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Tue, 19 Jan 2010 16:28:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-2493</guid>
		<description>You know, I figured they might run at the same time which defeats the purpose -- I forgot one important caveat -- we want to run the collapse function AFTER the scroll function has completed:

&lt;pre name=&quot;code&quot; class=&quot;css&quot;&gt;
jQuery(&#039;a#slick-slidetoggle&#039;).click(function() {
	// Only scroll up if we’re closing the DIV 
	if (jQuery(&#039;#main&#039;).height() != 0) {
		
		jQuery.scrollTo( jQuery(&#039;#header-wrap&#039;), {duration: 800, axis:&quot;y&quot;, onAfter:function(){
			jQuery(&#039;#main&#039;).slideToggle(800);
		 });

	} else {

		jQuery(&#039;#main&#039;).slideToggle(800);

	} 

	return false;

});
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You know, I figured they might run at the same time which defeats the purpose &#8212; I forgot one important caveat &#8212; we want to run the collapse function AFTER the scroll function has completed:</p>
<pre name="code" class="css">
jQuery('a#slick-slidetoggle').click(function() {
	// Only scroll up if we’re closing the DIV 
	if (jQuery('#main').height() != 0) {

		jQuery.scrollTo( jQuery('#header-wrap'), {duration: 800, axis:"y", onAfter:function(){
			jQuery('#main').slideToggle(800);
		 });

	} else {

		jQuery('#main').slideToggle(800);

	} 

	return false;

});
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darryl</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-2491</link>
		<dc:creator>Darryl</dc:creator>
		<pubDate>Tue, 19 Jan 2010 10:30:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-2491</guid>
		<description>(meant to say above that I think part of my problem with the scrollTo snippet was the if statement... but too much of a beginner to know how to set it right. thanks)</description>
		<content:encoded><![CDATA[<p>(meant to say above that I think part of my problem with the scrollTo snippet was the if statement&#8230; but too much of a beginner to know how to set it right. thanks)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darryl</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-2489</link>
		<dc:creator>Darryl</dc:creator>
		<pubDate>Tue, 19 Jan 2010 09:43:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-2489</guid>
		<description>Hi Pete,

Thanks so much for your efforts!  I wasnt able to get the JQuery snippet you suggested to work Im afraid but subsequently found a very similar workaround that has the same effect I think:

jQuery(&#039;html&#039;).scrollTop(0);

Obviously with speed &#039;0&#039; the page jumps up to the top and if I slow down the speed of the scrollTop to say 800 (as your example would) then I get the same sort of flickering as both the collapse and scrollTop events happen at the same time and sort of fight each other I guess.

So I think I am left deciding whether it is more acceptable to skip up to the top of the page sharpish or flicker my way back up.  (Neither hardly ideal for the user - ho hum).

Again thanks for your direction. :o)</description>
		<content:encoded><![CDATA[<p>Hi Pete,</p>
<p>Thanks so much for your efforts!  I wasnt able to get the JQuery snippet you suggested to work Im afraid but subsequently found a very similar workaround that has the same effect I think:</p>
<p>jQuery(&#8216;html&#8217;).scrollTop(0);</p>
<p>Obviously with speed &#8216;0&#8242; the page jumps up to the top and if I slow down the speed of the scrollTop to say 800 (as your example would) then I get the same sort of flickering as both the collapse and scrollTop events happen at the same time and sort of fight each other I guess.</p>
<p>So I think I am left deciding whether it is more acceptable to skip up to the top of the page sharpish or flicker my way back up.  (Neither hardly ideal for the user &#8211; ho hum).</p>
<p>Again thanks for your direction. <img src='http://www.adrogen.com/blog/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-2486</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Tue, 19 Jan 2010 03:31:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-2486</guid>
		<description>Hi Darryl,

Sorry for your frustration.  Actually, the reason your getting your flicker is different from the problem illustrated here.

Your expand/collapse is actually increasing the entire height of your site (which you obviously already know) increasing the vertical scroll bar.  When its collapsed, the entire height of the site decreases back.  The flicker comes from the browser being pushed back up.

There is no known work around for this issue.

HOWEVER!  hehe.  What I would do is actually scroll the window back up to the top BEFORE you collapse the DIV.  This way, the browser window will be at the top whilst the viewing area gets smaller, and then you shouldn&#039;t have any flicker.

And lucky for you, there&#039;s already a jQuery add on for this very thing.  Its called jQuery.ScrollTo and it can be found here:

http://flesler.blogspot.com/2007/10/jqueryscrollto.html

So, what you&#039;ll have to do is modify your on click like this:

jQuery(&#039;a#slick-slidetoggle&#039;).click(function() {
	
	// Only scroll up if we&#039;re closing the DIV
	if (jQuery(&#039;#main&#039;).height() != 0) {
		jQuery.scrollTo( jQuery(&#039;#header-wrap&#039;), 800 );
            }
	jQuery(&#039;#main&#039;).slideToggle(800);
     
	return false;

  });


This should scroll the window up to the top before it collapses your DIV -- This should stop the flicker (hopefully)  Let me know how it goes

*Note -- i&#039;m making it go to the div with ID header-wrap since its at the top of your page.</description>
		<content:encoded><![CDATA[<p>Hi Darryl,</p>
<p>Sorry for your frustration.  Actually, the reason your getting your flicker is different from the problem illustrated here.</p>
<p>Your expand/collapse is actually increasing the entire height of your site (which you obviously already know) increasing the vertical scroll bar.  When its collapsed, the entire height of the site decreases back.  The flicker comes from the browser being pushed back up.</p>
<p>There is no known work around for this issue.</p>
<p>HOWEVER!  hehe.  What I would do is actually scroll the window back up to the top BEFORE you collapse the DIV.  This way, the browser window will be at the top whilst the viewing area gets smaller, and then you shouldn&#8217;t have any flicker.</p>
<p>And lucky for you, there&#8217;s already a jQuery add on for this very thing.  Its called jQuery.ScrollTo and it can be found here:</p>
<p><a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html" rel="nofollow">http://flesler.blogspot.com/2007/10/jqueryscrollto.html</a></p>
<p>So, what you&#8217;ll have to do is modify your on click like this:</p>
<p>jQuery(&#8216;a#slick-slidetoggle&#8217;).click(function() {</p>
<p>	// Only scroll up if we&#8217;re closing the DIV<br />
	if (jQuery(&#8216;#main&#8217;).height() != 0) {<br />
		jQuery.scrollTo( jQuery(&#8216;#header-wrap&#8217;), 800 );<br />
            }<br />
	jQuery(&#8216;#main&#8217;).slideToggle(800);</p>
<p>	return false;</p>
<p>  });</p>
<p>This should scroll the window up to the top before it collapses your DIV &#8212; This should stop the flicker (hopefully)  Let me know how it goes</p>
<p>*Note &#8212; i&#8217;m making it go to the div with ID header-wrap since its at the top of your page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darryl</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-2485</link>
		<dc:creator>Darryl</dc:creator>
		<pubDate>Tue, 19 Jan 2010 02:21:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-2485</guid>
		<description>Hi Pete, Im sure my heartrate shot up to an excitable and optimistic 160bpm+ when I started reading that just adding the -x or -y would finally fix this beast for me, which I guess only exagerated the utter despondency when it didnt seem to work.

Maybe a similar issue to Uzair above but I have coded the overflow-y styling into my &#039;#main&#039; div (and can see it in Firebug) but the bugger is still flickering its way back up the screen when I collapse.  

www.thebeverley.com 

Am I missing something perhaps or is this not quite the messiah I was looking for?  Many thanks.</description>
		<content:encoded><![CDATA[<p>Hi Pete, Im sure my heartrate shot up to an excitable and optimistic 160bpm+ when I started reading that just adding the -x or -y would finally fix this beast for me, which I guess only exagerated the utter despondency when it didnt seem to work.</p>
<p>Maybe a similar issue to Uzair above but I have coded the overflow-y styling into my &#8216;#main&#8217; div (and can see it in Firebug) but the bugger is still flickering its way back up the screen when I collapse.  </p>
<p><a href="http://www.thebeverley.com" rel="nofollow">http://www.thebeverley.com</a> </p>
<p>Am I missing something perhaps or is this not quite the messiah I was looking for?  Many thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uzair Khan</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-2354</link>
		<dc:creator>Uzair Khan</dc:creator>
		<pubDate>Fri, 01 Jan 2010 21:19:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-2354</guid>
		<description>thanks for taking out the time Pete, but i was referring to the portfolio page which can be accessed at: http://www.uzairs.com/portfolio.php. You would see two headings, works and photography, if you expand both and then toggle the photography block, the page flickers on firefox. I tried applying overflow-y:hidden to both the content block within which the two blocks exist and the photography block but it didnt help. NOTE: I only tested it out through firebug. Thanks.</description>
		<content:encoded><![CDATA[<p>thanks for taking out the time Pete, but i was referring to the portfolio page which can be accessed at: <a href="http://www.uzairs.com/portfolio.php" rel="nofollow">http://www.uzairs.com/portfolio.php</a>. You would see two headings, works and photography, if you expand both and then toggle the photography block, the page flickers on firefox. I tried applying overflow-y:hidden to both the content block within which the two blocks exist and the photography block but it didnt help. NOTE: I only tested it out through firebug. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://www.adrogen.com/blog/jquery-flicker-in-firefox/comment-page-1/#comment-2348</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Thu, 31 Dec 2009 16:04:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.adrogen.com/blog/?p=31#comment-2348</guid>
		<description>Thanks for the compliment Uzair.

As for your site, are you referring to the DIV with the id designbox on the site linked from your name?  If so, I&#039;m not seeing the plane of overflow applied.  Since your scroller is moving horizontally, you&#039;d want to apply it across the X access:

div id=&quot;designbox&quot; style=&quot;&lt;strong&gt;overflow-x: hidden;&lt;/strong&gt; width: 390px; height: 284px;&quot;

Hope that helps!</description>
		<content:encoded><![CDATA[<p>Thanks for the compliment Uzair.</p>
<p>As for your site, are you referring to the DIV with the id designbox on the site linked from your name?  If so, I&#8217;m not seeing the plane of overflow applied.  Since your scroller is moving horizontally, you&#8217;d want to apply it across the X access:</p>
<p>div id=&#8221;designbox&#8221; style=&#8221;<strong>overflow-x: hidden;</strong> width: 390px; height: 284px;&#8221;</p>
<p>Hope that helps!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
