<?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: Vertical alignment of contents inside an element using jQuery</title>
	<atom:link href="http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/feed" rel="self" type="application/rss+xml" />
	<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html</link>
	<description>The best javascripts for your site</description>
	<lastBuildDate>Fri, 14 Oct 2011 00:50:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Ricardo Zea</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-11945</link>
		<dc:creator>Ricardo Zea</dc:creator>
		<pubDate>Wed, 06 Apr 2011 18:36:42 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-11945</guid>
		<description>Not sure how to make code show up...</description>
		<content:encoded><![CDATA[<p>Not sure how to make code show up&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricardo Zea</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-11944</link>
		<dc:creator>Ricardo Zea</dc:creator>
		<pubDate>Wed, 06 Apr 2011 18:35:43 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-11944</guid>
		<description>HTML:

  Content to be centered
</description>
		<content:encoded><![CDATA[<p>HTML:</p>
<p>  Content to be centered</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricardo Zea</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-11943</link>
		<dc:creator>Ricardo Zea</dc:creator>
		<pubDate>Wed, 06 Apr 2011 18:34:56 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-11943</guid>
		<description>A solution without the need for JavaScript:

CSS:
div { display:table-cell; vertical-align:middle; height:300px; }

HTML:

  Content to be centered


Works in every browser except IE6 and IE7... although by this point you should be phasing out support for those browsers, at least.

This script is my backup to the above solution.

Thanks.</description>
		<content:encoded><![CDATA[<p>A solution without the need for JavaScript:</p>
<p>CSS:<br />
div { display:table-cell; vertical-align:middle; height:300px; }</p>
<p>HTML:</p>
<p>  Content to be centered</p>
<p>Works in every browser except IE6 and IE7&#8230; although by this point you should be phasing out support for those browsers, at least.</p>
<p>This script is my backup to the above solution.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gonz</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-6775</link>
		<dc:creator>Gonz</dc:creator>
		<pubDate>Sat, 22 May 2010 01:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-6775</guid>
		<description>Thanks for this plugin - this really helped - darn the CSS gods for making this a hassle.</description>
		<content:encoded><![CDATA[<p>Thanks for this plugin &#8211; this really helped &#8211; darn the CSS gods for making this a hassle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-4775</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 05 Jan 2010 10:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-4775</guid>
		<description>Hi Matt,

Thanks for visiting my blog and posting comment.
Regarding your question, I think it may be due to the image tag. If you&#039;re calling this method in &lt;em&gt;document.ready()&lt;/em&gt;, this may happen. Because, document.ready() triggers when the html is loaded - at that time, the images may not be downloaded fully and hence the function will fail. It will work the second time as the image is already cached in browser. 

You may try the following to fix the problem.

If possible, include the width and height attribute to the image tag (May be if you&#039;re using, server side scripts like PHP, it should be possible).  Eg: &lt;img width=&quot;300&quot; height=&quot;200&quot; src= &quot;&quot; /&gt;&lt;/li&gt;

Try calling the align function on &lt;strong&gt;window.load()&lt;/strong&gt; instead of &lt;em&gt;document.ready()&lt;/em&gt;. (Because window.load() will be triggered only after loading all images and full dependencies) 
Eg: &lt;em&gt;$(window).load(function(){$(&quot;div.special&quot;).vAlign()});&lt;/em&gt;


Hope this helps :)</description>
		<content:encoded><![CDATA[<p>Hi Matt,</p>
<p>Thanks for visiting my blog and posting comment.<br />
Regarding your question, I think it may be due to the image tag. If you&#8217;re calling this method in <em>document.ready()</em>, this may happen. Because, document.ready() triggers when the html is loaded &#8211; at that time, the images may not be downloaded fully and hence the function will fail. It will work the second time as the image is already cached in browser. </p>
<p>You may try the following to fix the problem.</p>
<p>If possible, include the width and height attribute to the image tag (May be if you&#8217;re using, server side scripts like PHP, it should be possible).  Eg: &lt;img width=&#8221;300&#8243; height=&#8221;200&#8243; src= &#8220;&#8221; /&gt;</p>
<p>Try calling the align function on <strong>window.load()</strong> instead of <em>document.ready()</em>. (Because window.load() will be triggered only after loading all images and full dependencies)<br />
Eg: <em>$(window).load(function(){$(&#8220;div.special&#8221;).vAlign()});</em></p>
<p>Hope this helps <img src='http://cool-javascripts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-4770</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Tue, 05 Jan 2010 03:34:52 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-4770</guid>
		<description>I am having problems with multiple instances of elements calling the plugin.

The first element that uses the plugin will vertically center, but often the elements that follow will not unless I refresh the browser.

I am vertically centering an image in a fixed width div multiple times on a page for a thumbnail gallery. The images vary in height, which is why I can&#039;t use strait css.

Any ideas on how to solve this issue?</description>
		<content:encoded><![CDATA[<p>I am having problems with multiple instances of elements calling the plugin.</p>
<p>The first element that uses the plugin will vertically center, but often the elements that follow will not unless I refresh the browser.</p>
<p>I am vertically centering an image in a fixed width div multiple times on a page for a thumbnail gallery. The images vary in height, which is why I can&#8217;t use strait css.</p>
<p>Any ideas on how to solve this issue?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: exeQutor</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-3565</link>
		<dc:creator>exeQutor</dc:creator>
		<pubDate>Tue, 03 Nov 2009 03:47:36 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-3565</guid>
		<description>Nice plugin. Although this looks like a copy/an enhancement based from: http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/</description>
		<content:encoded><![CDATA[<p>Nice plugin. Although this looks like a copy/an enhancement based from: <a href="http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/" rel="nofollow">http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emre GULCAN</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-128</link>
		<dc:creator>Emre GULCAN</dc:creator>
		<pubDate>Fri, 20 Feb 2009 13:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-128</guid>
		<description>thank you for your sharing. 
I need a solution like that. I&#039;m using a Css hoverbox image gallery and need align vertically images in a div :)
I&#039;m trying different solutions for 2 days and now, everything is ok..
thank you again.
Regards from Turkey ;)</description>
		<content:encoded><![CDATA[<p>thank you for your sharing.<br />
I need a solution like that. I&#8217;m using a Css hoverbox image gallery and need align vertically images in a div <img src='http://cool-javascripts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I&#8217;m trying different solutions for 2 days and now, everything is ok..<br />
thank you again.<br />
Regards from Turkey <img src='http://cool-javascripts.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Kieffer</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-50</link>
		<dc:creator>Chad Kieffer</dc:creator>
		<pubDate>Tue, 13 Jan 2009 03:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-50</guid>
		<description>Thanks for sharing this. I&#039;d just implemented a similar solution. One suggestion, I&#039;d recommend passing the paddingPx as an argument rather than instructing users to change it in the function. Treat it just like you handle the wrapping element, but default to 0, instead of 10.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing this. I&#8217;d just implemented a similar solution. One suggestion, I&#8217;d recommend passing the paddingPx as an argument rather than instructing users to change it in the function. Treat it just like you handle the wrapping element, but default to 0, instead of 10.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Simpson</title>
		<link>http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html/comment-page-1#comment-48</link>
		<dc:creator>Kyle Simpson</dc:creator>
		<pubDate>Mon, 12 Jan 2009 16:32:15 +0000</pubDate>
		<guid isPermaLink="false">http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html#comment-48</guid>
		<description>I&#039;m wondering if this same approach could be taken to create a html/css construct for the &quot;valign&quot; that would actually &quot;reflow&quot; (that is, keep the content centered vertically if the container changes size (like a browser resize, more content added, etc)?

There are sites out there which have created some crazy constructs for that, and using a plugin approach like this to artificially create that set of constructs might be really helpful, not just in one-time layouts (like the current plugin) but in fluid layouts which are subject to resize/reflows.

Here&#039;s an example of persistent vertical centering using CSS/html constructs:  

http://www.jakpsatweb.cz/css/css-vertical-center-solution.html</description>
		<content:encoded><![CDATA[<p>I&#8217;m wondering if this same approach could be taken to create a html/css construct for the &#8220;valign&#8221; that would actually &#8220;reflow&#8221; (that is, keep the content centered vertically if the container changes size (like a browser resize, more content added, etc)?</p>
<p>There are sites out there which have created some crazy constructs for that, and using a plugin approach like this to artificially create that set of constructs might be really helpful, not just in one-time layouts (like the current plugin) but in fluid layouts which are subject to resize/reflows.</p>
<p>Here&#8217;s an example of persistent vertical centering using CSS/html constructs:  </p>
<p><a href="http://www.jakpsatweb.cz/css/css-vertical-center-solution.html" rel="nofollow">http://www.jakpsatweb.cz/css/css-vertical-center-solution.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

