<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.waycoolwebdesign.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>jquery</title>
 <link>http://www.waycoolwebdesign.com/Blog/jquery</link>
 <description>The taxonomy view with a depth of 0.</description>
 <language>en</language>
<item>
 <title>Vertical Centering of Tableless HTML Using CSS and jQuery</title>
 <link>http://www.waycoolwebdesign.com/Blog/2010/02/17/Vertical-Centering-Tableless-HTML-Using-CSS-and-jQuery</link>
 <description>&lt;p&gt;I&#039;ve seen other &lt;a href=&quot;http://www.jakpsatweb.cz/css/css-vertical-center-solution.html&quot; target=&quot;_blank&quot;&gt;vertical text centering techniques&lt;/a&gt; and used them successfully in certain situations. There seemed to be other situations where I couldn&#039;t get the techniques to work. I figured I&#039;d give jQuery a try and see if I could work it out more easily for a group of objects. For my purposes, creating a list of links, I needed to use a fixed height for the &amp;lt;li&amp;gt;. &lt;/p&gt;
&lt;p&gt;Final should look something like this:&lt;/p&gt;
&lt;div class=&quot;google_ad1&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-2938344934790216&quot;;
/* 200x200 for Blog, created 3/11/09 */
google_ad_slot = &quot;6360764911&quot;;
google_ad_width = 200;
google_ad_height = 200;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/div&gt;&lt;div class=&quot;vertical1&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span&gt;Item 1&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span&gt;Item 2 is a little bit longer&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span&gt;Item 3 is ridiculously long. Hopefully it feels more important now that it has used so much space.&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;So you&#039;ll need a list. I was making clickable buttons with backgrounds so my HTML/CSS may have more tags than you&#039;ll need. I ended up needing some &amp;lt;span&amp;gt; tags inside the &amp;lt;a&amp;gt; tags, such as:&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&amp;quot;vertical1&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;ul&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;span&amp;gt;Item 1&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;span&amp;gt;Item 2 is a little bit longer&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;span&amp;gt;Item 3 is ridiculously long. Hopefully it feels more important now that it has used so much space.&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;div class=&quot;google_ad1&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-2938344934790216&quot;;
/* 200x200 for Blog, created 3/11/09 */
google_ad_slot = &quot;6360764911&quot;;
google_ad_width = 200;
google_ad_height = 200;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/div&gt;&lt;p&gt;For CSS, use something like the below. I had needed:&lt;br /&gt;.vertical1 ul,&lt;br /&gt;.vertical1 li    {&lt;br /&gt;    margin: 0;&lt;br /&gt;    padding: 0;&lt;br /&gt;    }&lt;br /&gt;.vertical1 li    {&lt;br /&gt;    background: none;&lt;br /&gt;    height: 135px;&lt;br /&gt;    width: 224px;&lt;br /&gt;    position: relative;&lt;br /&gt;    margin-top: 9px;&lt;br /&gt;    }&lt;br /&gt;.vertical1 a    {&lt;br /&gt;    color: #000;&lt;br /&gt;    height: 135px;&lt;br /&gt;    width: 224px;&lt;br /&gt;    display: block;&lt;br /&gt;    background: none orange;&lt;br /&gt;    border: none;&lt;br /&gt;    }&lt;br /&gt;.vertical1 a:hover    {&lt;br /&gt;    background-position: 0 -135px;&lt;br /&gt;    }&lt;br /&gt;.vertical1 span    {&lt;br /&gt;    position: absolute;&lt;br /&gt;    display: block;&lt;br /&gt;    width: 140px;&lt;br /&gt;    margin-left: 15px;&lt;br /&gt;    line-height: 1.1111em;&lt;br /&gt;    font-size: 12px;&lt;br /&gt;    }&lt;/p&gt;
&lt;p&gt;You&#039;ll need &lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;. Use something like this:&lt;br /&gt;$(&amp;quot;.vertical1 li&amp;quot;).each(function () { &lt;br /&gt;       li_height = $(this).height();&lt;br /&gt;       span_height = $(this).find(&amp;quot;span&amp;quot;).height();&lt;br /&gt;       halfway = (li_height/2) - (span_height/2);&lt;br /&gt;       $(this).find(&amp;quot;span&amp;quot;).css(&amp;quot;top&amp;quot;, halfway);&lt;br /&gt;    });&lt;/p&gt;</description>
 <comments>http://www.waycoolwebdesign.com/Blog/2010/02/17/Vertical-Centering-Tableless-HTML-Using-CSS-and-jQuery#comments</comments>
 <category domain="http://www.waycoolwebdesign.com/Blog/HTML-CSS">HTML &amp;amp; CSS</category>
 <category domain="http://www.waycoolwebdesign.com/Blog/jquery">jquery</category>
 <pubDate>Wed, 17 Feb 2010 10:31:35 -0500</pubDate>
 <dc:creator>John</dc:creator>
 <guid isPermaLink="false">250 at http://www.waycoolwebdesign.com</guid>
</item>
<item>
 <title>Drupal Jquery JCarousel Implementation</title>
 <link>http://www.waycoolwebdesign.com/Blog/2010/01/31/Drupal-Jquery-JCarousel-Implementation</link>
 <description>&lt;div class=&quot;google_ad1&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-2938344934790216&quot;;
/* 200x200 for Blog, created 3/11/09 */
google_ad_slot = &quot;6360764911&quot;;
google_ad_width = 200;
google_ad_height = 200;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/div&gt;&lt;p&gt;A recent project put us in need of a carousel. Jcarousel provided the basics for what we needed however we had to add some additional love to get the carousel working the way the client envisioned.&lt;/p&gt;&lt;p&gt;We had to theme the block.tpl file for the carousel, using PHP to achieve our goal. The biggest issue we needed to address was that the carousel would need to start on the same thumbnail (depending on a page&#039;s parent) whether it was on a parent or child page. So even though jcarousel provides a way to start the carousel on a particular thumbnail, we needed a dynamic way to do that since the &amp;quot;home&amp;quot; thumbnail changes throughout the site depending on which project you are on. If you land on Parent A or on anyof Parent A&#039;s child pages, the carousel needed to start withProject A&#039;s thumbnail.&lt;/p&gt;
&lt;div class=&quot;google_ad1&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-2938344934790216&quot;;
/* 200x200 for Blog, created 3/11/09 */
google_ad_slot = &quot;6360764911&quot;;
google_ad_width = 200;
google_ad_height = 200;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/div&gt;&lt;p&gt;First we needed to control project parents vs. project children. We used 2 content types for this, with a selector on the child type so we could choose which project parent it belonged to. We added a CCK field to project parents allowing them to choose a carousel ordering.&lt;/p&gt;
&lt;p&gt;Next we created a view that pulled the parents as a simple HTML list. Each parent also has a huge background photo, so we used imagecache to create a thumbnail from this for the carousel. The view was shown in a block, whose view-view-list--carousel--block.tpl.php file we themed. We loaded the node form the block:&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;$nodeid = (arg(0) == &#039;node&#039; &amp;amp;&amp;amp; is_numeric(arg(1)))?arg(1):FALSE;&lt;br/ &gt; $node = node_load($nodeid); $nid = $node-&amp;gt;nid;&lt;/pre&gt;&lt;br /&gt;...and depending on the node type there was further code. If it was a child we looked for its parent.&lt;/p&gt;
&lt;p&gt;Once we determined the parent (or found out we were already on a parent), we could grab the carousel order from the CCK field of the project we were on so we could tell jcarousel to $start on that item. We also used jquery to provide an active class to the current list item since Drupal wouldn&#039;t necessarily do that if were on a child page.&lt;/p&gt;
&lt;p&gt;Using the technique above we were able to create a carousel that starts at an appropriate place even if we aren&#039;t specifically on that page. As long as we&#039;re on any of a project&#039;s pages, the carousel starts correctly and we can even style it as such with the addition of an appropriate active class. &lt;/p&gt;
&lt;p&gt;You may still be able to see the carousel at QuinnEvans.com in the project section.&lt;/p&gt;
</description>
 <comments>http://www.waycoolwebdesign.com/Blog/2010/01/31/Drupal-Jquery-JCarousel-Implementation#comments</comments>
 <category domain="http://www.waycoolwebdesign.com/Blog/Drupal">Drupal</category>
 <category domain="http://www.waycoolwebdesign.com/Blog/jquery">jquery</category>
 <pubDate>Sun, 31 Jan 2010 17:59:39 -0500</pubDate>
 <dc:creator>John</dc:creator>
 <guid isPermaLink="false">234 at http://www.waycoolwebdesign.com</guid>
</item>
</channel>
</rss>

