<?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-Based Popout Ad: Part 2</title> <atom:link href="http://www.cssnewbie.com/jquery-popout-ad-part-2/feed/" rel="self" type="application/rss+xml" /><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/</link> <description>Web Development Tutorials, Tips &#38; Techniques</description> <lastBuildDate>Sun, 14 Mar 2010 23:57:36 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: Andrew</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-9643</link> <dc:creator>Andrew</dc:creator> <pubDate>Fri, 24 Apr 2009 10:03:34 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-9643</guid> <description>Mrmrmr.... Doesnt work in Firefox 3.09</description> <content:encoded><![CDATA[<p>Mrmrmr&#8230;. Doesnt work in Firefox 3.09</p> ]]></content:encoded> </item> <item><title>By: Mark</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-9633</link> <dc:creator>Mark</dc:creator> <pubDate>Wed, 22 Apr 2009 19:22:51 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-9633</guid> <description>Nevermind, I fixed it.  CSS issue with the close button positioning :)</description> <content:encoded><![CDATA[<p>Nevermind, I fixed it.  CSS issue with the close button positioning :)</p> ]]></content:encoded> </item> <item><title>By: Mark</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-9632</link> <dc:creator>Mark</dc:creator> <pubDate>Wed, 22 Apr 2009 19:15:55 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-9632</guid> <description>it&#039;s not working with chrome so well.  it closes then gets stuck closed.  all other browsers ok.</description> <content:encoded><![CDATA[<p>it&#8217;s not working with chrome so well.  it closes then gets stuck closed.  all other browsers ok.</p> ]]></content:encoded> </item> <item><title>By: Rob</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-8641</link> <dc:creator>Rob</dc:creator> <pubDate>Fri, 24 Oct 2008 21:15:47 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-8641</guid> <description>Yep! This works pretty well for forms. I&#039;ve used it for signup forms on more than one website now.</description> <content:encoded><![CDATA[<p>Yep! This works pretty well for forms. I&#8217;ve used it for signup forms on more than one website now.</p> ]]></content:encoded> </item> <item><title>By: Carlos @ VPSmedia</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-8639</link> <dc:creator>Carlos @ VPSmedia</dc:creator> <pubDate>Fri, 24 Oct 2008 21:07:24 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-8639</guid> <description>Wow really cool. Can this be done with say a form? being able to use it to display a login form would be interesting.</description> <content:encoded><![CDATA[<p>Wow really cool. Can this be done with say a form? being able to use it to display a login form would be interesting.</p> ]]></content:encoded> </item> <item><title>By: Rob Glazebrook</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-8440</link> <dc:creator>Rob Glazebrook</dc:creator> <pubDate>Thu, 25 Sep 2008 21:23:13 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-8440</guid> <description>...and now that I&#039;ve said that, I&#039;ve come up with a third, better, option.Instead of using a background color, use a background image instead. It turns out that a repeated background image works just as well to give the anchor its proper size. So I&#039;ve created a 1x1 transparent gif and set that as the anchor&#039;s background in my CSS. The close button now works. I&#039;ll get the example updated right away, and then update the tutorial soon.</description> <content:encoded><![CDATA[<p>&#8230;and now that I&#8217;ve said that, I&#8217;ve come up with a third, better, option.</p><p>Instead of using a background color, use a background image instead. It turns out that a repeated background image works just as well to give the anchor its proper size. So I&#8217;ve created a 1&#215;1 transparent gif and set that as the anchor&#8217;s background in my CSS. The close button now works. I&#8217;ll get the example updated right away, and then update the tutorial soon.</p> ]]></content:encoded> </item> <item><title>By: Rob Glazebrook</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-8439</link> <dc:creator>Rob Glazebrook</dc:creator> <pubDate>Thu, 25 Sep 2008 21:03:42 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-8439</guid> <description>Wow, Tom... you&#039;re right. There&#039;s a pretty major IE7 bug in there. And setting the background color does seem to fix it.The problem is, IE7 ignores the size you specify on a link if the content (text, image, whatever) doesn&#039;t take up all the space you&#039;ve given it. And because we&#039;ve set a &quot;display: none&quot; on the content, IE7 can&#039;t find anything to click on. Never mind the fact we&#039;re in &quot;display: block&quot; mode with a specified width and height.However, as you pointed out, setting a background color makes it respect the size of our box. Of course, that also obscures our close button.We have two options: first, we could just cut the close button out of our ad design, create it as a separate image, and put that in our close anchor. The anchor would be clickable, because it was filled with the image.Or two, you can set a background color on the anchor tag, and then HIDE that color by setting its opacity to zero. IE7 still respects our size for whatever reason. Unfortunately, there seems to be an opacity bug in IE6 wherein the opacity filter doesn&#039;t take into account positioned elements: the close button becomes transparent all the way down to the document underneath. So if you need IE6 support, this isn&#039;t the best option. But it works elsewhere.</description> <content:encoded><![CDATA[<p>Wow, Tom&#8230; you&#8217;re right. There&#8217;s a pretty major IE7 bug in there. And setting the background color does seem to fix it.</p><p>The problem is, IE7 ignores the size you specify on a link if the content (text, image, whatever) doesn&#8217;t take up all the space you&#8217;ve given it. And because we&#8217;ve set a &#8220;display: none&#8221; on the content, IE7 can&#8217;t find anything to click on. Never mind the fact we&#8217;re in &#8220;display: block&#8221; mode with a specified width and height.</p><p>However, as you pointed out, setting a background color makes it respect the size of our box. Of course, that also obscures our close button.</p><p>We have two options: first, we could just cut the close button out of our ad design, create it as a separate image, and put that in our close anchor. The anchor would be clickable, because it was filled with the image.</p><p>Or two, you can set a background color on the anchor tag, and then HIDE that color by setting its opacity to zero. IE7 still respects our size for whatever reason. Unfortunately, there seems to be an opacity bug in IE6 wherein the opacity filter doesn&#8217;t take into account positioned elements: the close button becomes transparent all the way down to the document underneath. So if you need IE6 support, this isn&#8217;t the best option. But it works elsewhere.</p> ]]></content:encoded> </item> <item><title>By: Tom OConnor</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-8437</link> <dc:creator>Tom OConnor</dc:creator> <pubDate>Tue, 23 Sep 2008 19:22:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-8437</guid> <description>For some reason this won&#039;t work on IE7.  And the oddest thing happened when I was working with it, in trying to make sure the button was still in the same place I applied a background color in the CSS, and then it works.  So literally, button doesn&#039;t move but it will work with a bg color and won&#039;t without.</description> <content:encoded><![CDATA[<p>For some reason this won&#8217;t work on IE7.  And the oddest thing happened when I was working with it, in trying to make sure the button was still in the same place I applied a background color in the CSS, and then it works.  So literally, button doesn&#8217;t move but it will work with a bg color and won&#8217;t without.</p> ]]></content:encoded> </item> <item><title>By: jQuery-Based Popout Ad: Part 1 - CSSnewbie</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-8418</link> <dc:creator>jQuery-Based Popout Ad: Part 1 - CSSnewbie</dc:creator> <pubDate>Thu, 18 Sep 2008 16:37:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-8418</guid> <description>[...] take into account a bug in Opera that causes our close button to be positioned improperly (you can read the details in the comment thread of part 2). The workaround is to position the close button according to the left edge of its container [...]</description> <content:encoded><![CDATA[<p>[...] take into account a bug in Opera that causes our close button to be positioned improperly (you can read the details in the comment thread of part 2). The workaround is to position the close button according to the left edge of its container [...]</p> ]]></content:encoded> </item> <item><title>By: Rob</title><link>http://www.cssnewbie.com/jquery-popout-ad-part-2/comment-page-1/#comment-8417</link> <dc:creator>Rob</dc:creator> <pubDate>Thu, 18 Sep 2008 16:23:06 +0000</pubDate> <guid
isPermaLink="false">http://www.cssnewbie.com/?p=225#comment-8417</guid> <description>Hi ReTox, thanks for the heads up. It&#039;s technically not a bug in the JavaScript, but a bug in Opera itself.Here&#039;s the deal: Opera respects the negative margin we give the ad initially, and it respects the new margin fed to it by jQuery&#039;s animation function as long as the ad is moving. But when jQuery sends it the final left margin of &quot;0,&quot; Opera seems to get confused and reverts back to the original margin of -300, effectively hiding the close button behind the cap and off the edge of the page.However, we&#039;ve found a pretty easy fix. In the CSS, instead of positioning the close button against the right side of our ad with a &quot;right: 0&quot; rule, we can put it into place with a &quot;left&quot; rule instead, pushing it away from the left side. I&#039;m not sure why this prevents the bug from triggering, but it seems to do the trick. I&#039;ve already updated the examples to the new CSS, and I&#039;ll update part 1 of the article to explain the bug and the fix.You can also fix this in the jQuery, but it&#039;s less of an elegant solution. I&#039;ve found that, if the animation&#039;s margin never hits zero, the bug is never triggered. So in the openAd function, if you stop the animation at &quot;-1px&quot; instead of at &quot;0&quot;, the bug isn&#039;t triggered. But then you have the leftmost edge of your ad hidden at all times, and that bothers me, which is why I&#039;m opting for the CSS workaround.</description> <content:encoded><![CDATA[<p>Hi ReTox, thanks for the heads up. It&#8217;s technically not a bug in the JavaScript, but a bug in Opera itself.</p><p>Here&#8217;s the deal: Opera respects the negative margin we give the ad initially, and it respects the new margin fed to it by jQuery&#8217;s animation function as long as the ad is moving. But when jQuery sends it the final left margin of &#8220;0,&#8221; Opera seems to get confused and reverts back to the original margin of -300, effectively hiding the close button behind the cap and off the edge of the page.</p><p>However, we&#8217;ve found a pretty easy fix. In the CSS, instead of positioning the close button against the right side of our ad with a &#8220;right: 0&#8243; rule, we can put it into place with a &#8220;left&#8221; rule instead, pushing it away from the left side. I&#8217;m not sure why this prevents the bug from triggering, but it seems to do the trick. I&#8217;ve already updated the examples to the new CSS, and I&#8217;ll update part 1 of the article to explain the bug and the fix.</p><p>You can also fix this in the jQuery, but it&#8217;s less of an elegant solution. I&#8217;ve found that, if the animation&#8217;s margin never hits zero, the bug is never triggered. So in the openAd function, if you stop the animation at &#8220;-1px&#8221; instead of at &#8220;0&#8243;, the bug isn&#8217;t triggered. But then you have the leftmost edge of your ad hidden at all times, and that bothers me, which is why I&#8217;m opting for the CSS workaround.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 5/20 queries in 0.061 seconds using disk

Served from: rhetorclick.com @ 2010-03-15 00:39:49 -->