<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Eureka!</title>
	<atom:link href="http://eureka.ykyuen.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://eureka.ykyuen.info</link>
	<description>Dream BIG and go for it =)</description>
	<lastBuildDate>Sat, 26 May 2012 04:00:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='eureka.ykyuen.info' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/9c99f3c76686bf5edf1ea460356f00f2?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Eureka!</title>
		<link>http://eureka.ykyuen.info</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://eureka.ykyuen.info/osd.xml" title="Eureka!" />
	<atom:link rel='hub' href='http://eureka.ykyuen.info/?pushpress=hub'/>
		<item>
		<title>名言五十</title>
		<link>http://eureka.ykyuen.info/2012/05/26/%e5%90%8d%e8%a8%80%e4%ba%94%e5%8d%81/</link>
		<comments>http://eureka.ykyuen.info/2012/05/26/%e5%90%8d%e8%a8%80%e4%ba%94%e5%8d%81/#comments</comments>
		<pubDate>Sat, 26 May 2012 04:00:46 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[Albert Einstein]]></category>
		<category><![CDATA[Dictum]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10419</guid>
		<description><![CDATA[The world is a dangerous place to live; not because of the people who are evil, but because of the people who don&#8217;t do anything about it. Albert Einstein The following quote is the chinese version with similar meaning. 知識分子應該對世界上任何不合理的現象表示自己的態度, &#8230; <a href="http://eureka.ykyuen.info/2012/05/26/%e5%90%8d%e8%a8%80%e4%ba%94%e5%8d%81/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10419&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote><p><font color="#330099">The world is a dangerous place to live; not because of the people who are evil, but because of the people who don&#8217;t do anything about it.</font></p></blockquote>
<p><strong>
<p style="text-align:right;">Albert Einstein</p>
<p></strong></p>
<p>The following quote is the chinese version with similar meaning.</p>
<blockquote><p><font color="#330099">知識分子應該對世界上任何不合理的現象表示自己的態度, 否則你就是幫兇。</font></p></blockquote>
<p><strong>
<p style="text-align:right;">愛因斯坦</p>
<p></strong></p>
<p><a href="http://ykyuen.files.wordpress.com/2012/04/albert-einstein.jpg"><img src="http://ykyuen.files.wordpress.com/2012/04/albert-einstein.jpg?w=584&h=437" alt="" title="albert-einstein" width="584" height="437" class="aligncenter size-full wp-image-10420" /></a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/philosophy/'>Philosophy</a> Tagged: <a href='http://eureka.ykyuen.info/tag/albert-einstein/'>Albert Einstein</a>, <a href='http://eureka.ykyuen.info/tag/dictum/'>Dictum</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10419/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10419&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/26/%e5%90%8d%e8%a8%80%e4%ba%94%e5%8d%81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>

		<media:content url="http://ykyuen.files.wordpress.com/2012/04/albert-einstein.jpg" medium="image">
			<media:title type="html">albert-einstein</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery &#8211; Using animate() with fadeIn() or fadeOut() at the same time</title>
		<link>http://eureka.ykyuen.info/2012/05/25/jquery-using-animate-with-fadein-or-fadeout-at-the-same-time/</link>
		<comments>http://eureka.ykyuen.info/2012/05/25/jquery-using-animate-with-fadein-or-fadeout-at-the-same-time/#comments</comments>
		<pubDate>Fri, 25 May 2012 04:00:40 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10381</guid>
		<description><![CDATA[We know the difference between display: none and visibility: hidden as we talked about it previously. jQuery &#8211; Animation on Visibility The fadeIn() and fadeOut() jQuery functions are very convenient to use but they does not allow us to add &#8230; <a href="http://eureka.ykyuen.info/2012/05/25/jquery-using-animate-with-fadein-or-fadeout-at-the-same-time/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10381&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We know the difference between <font color="#008000">display: none</font> and <font color="#008888">visibility: hidden</font> as we talked about it previously.<br />
<a href="http://eureka.ykyuen.info/2012/05/24/jquery-animation-on-visibility/" target="_blank">jQuery &#8211; Animation on Visibility</a></p>
<p>The <font color="#0000FF">fadeIn()</font> and <font color="#FF0000">fadeOut()</font> <font color="#880088">jQuery</font> functions are very convenient to use but they does not allow us to add <font color="#8A0808">animation</font> during the <font color="#0000FF">fadeIn</font> and <font color="#FF0000">fadeOut</font> process. So we have to do it with a slightly different way.<br />
<span id="more-10381"></span><br />
Initially we have a <font color="#6E6E6E">hidden div</font>.<br />
<pre class="brush: css;">
#show-me {
  visibility: hidden;
  opacity: 0.0;
  position: relative;
}
</pre><br />
&nbsp;</p>
<p>And then we have a <font color="#880088">jQuery</font> script which show the <font color="#6E6E6E">hidden</font> element and the text will move from the left to the right during the <font color="#0000FF">fadeIn</font> process.<br />
<pre class="brush: jscript;">
$(document).ready(function() {
  $('#show-me')
    .css('visibility', 'visible')
    .animate({opacity: 1.0, left: '100px'}, 2000);
});
</pre><br />
&nbsp;</p>
<p>This is the complete example.<br />
<pre class="brush: xml;">
&lt;html&gt;
  &lt;head&gt;
    &lt;style type=&quot;text/css&quot;&gt;
      #show-me {
        visibility: hidden;
        opacity: 0.0;
        position: relative;
      }
    &lt;/style&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
      $(document).ready(function() {
        $('#show-me')
          .css('visibility', 'visible')
          .animate({opacity: 1.0, left: '100px'}, 2000);
      });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id=&quot;show-me&quot;&gt;
      &lt;a href=&quot;http://eureka.ykyuen.info&quot;&gt;Eureka!&lt;/a&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre><br />
&nbsp;</p>
<p>We can also use <font color="#008000">display</font> instead of <font color="#008888">visibility</font>.<br />
<pre class="brush: xml;">
&lt;html&gt;
  &lt;head&gt;
    &lt;style type=&quot;text/css&quot;&gt;
      #show-me {
        display: none;
        opacity: 0.0;
        position: relative;
      }
    &lt;/style&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
      $(document).ready(function() {
        $('#show-me')
          .css('display', 'block')
          .animate({opacity: 1.0, left: '100px'}, 2000);
      });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id=&quot;show-me&quot;&gt;
      &lt;a href=&quot;http://eureka.ykyuen.info&quot;&gt;Eureka!&lt;/a&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre><br />
&nbsp;</p>
<p>Here is another example for <font color="#0000FF">fading out</font> <font color="#FF8000">HTML</font> element with <font color="#8A0808">animation</font>.<br />
<pre class="brush: xml;">
&lt;html&gt;
  &lt;head&gt;
    &lt;style type=&quot;text/css&quot;&gt;
      #hide-me {
        position: relative;
      }
    &lt;/style&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
      $(document).ready(function() {
        $('#hide-me').animate({opacity: 0.0, left: '100px'}, 2000, setInvisible);
      });
      
      function setInvisible() {
        $('#hide-me').css('visibility', 'hidden');
      }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id=&quot;hide-me&quot;&gt;
      &lt;a href=&quot;http://eureka.ykyuen.info&quot;&gt;Eureka!&lt;/a&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre><br />
&nbsp;</p>
<p>Done =)</p>
<p>Reference: <a href="http://stackoverflow.com/questions/1652576/how-do-you-fadein-and-animate-at-the-same-time" target="_blank">StackOverflow &#8211; How do you fadeIn and animate at the same time?</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/jquery/'>jQuery</a> Tagged: <a href='http://eureka.ykyuen.info/tag/css/'>CSS</a>, <a href='http://eureka.ykyuen.info/tag/javascript/'>Javascript</a>, <a href='http://eureka.ykyuen.info/tag/jquery/'>jQuery</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10381/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10381&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/25/jquery-using-animate-with-fadein-or-fadeout-at-the-same-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery &#8211; Animation on Visibility</title>
		<link>http://eureka.ykyuen.info/2012/05/24/jquery-animation-on-visibility/</link>
		<comments>http://eureka.ykyuen.info/2012/05/24/jquery-animation-on-visibility/#comments</comments>
		<pubDate>Thu, 24 May 2012 04:00:00 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10374</guid>
		<description><![CDATA[Next: jQuery – Using animate() with fadeIn() or fadeOut() at the same time We can hide and show any HTML elements by the fadeIn() and fadeOut() jQuery functions. Those elements will be set to display: none in CSS. Unlike setting &#8230; <a href="http://eureka.ykyuen.info/2012/05/24/jquery-animation-on-visibility/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10374&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Next: <a href="http://eureka.ykyuen.info/2012/05/25/jquery-using-animate-with-fadein-or-fadeout-at-the-same-time/" target="_blank">jQuery – Using animate() with fadeIn() or fadeOut() at the same time</a></p>
<p>We can hide and show any <font color="#FF8000">HTML</font> elements by the <font color="#0000FF">fadeIn()</font> and <font color="#FF0000">fadeOut()</font> <font color="#880088">jQuery</font> functions. Those elements will be set to <font color="#008000">display: none</font> in <font color="#FF00FF">CSS</font>. Unlike setting <font color="#008888">visibility: hidden</font> which the hidden element will still occupied some spaces in the rendered web page, the faded out element will disappear.</p>
<p>So if you want to have the <font color="#0000FF">fadeIn</font> and <font color="#FF0000">fadeOut</font> features while keeping the elements in the webpage, here is what you could do.<br />
<span id="more-10374"></span><br />
First, set the element with <font color="#008888">visibility: hidden</font> and <font color="#8A0808">opacity: 0.0</font>.<br />
<pre class="brush: css;">
#show-me {
  visibility: hidden;
  opacity: 0.0;
}
</pre><br />
&nbsp;</p>
<p>Second, make the element visible when the <font color="#880088">DOM</font> is ready.<br />
<pre class="brush: jscript;">
$(document).ready(function() {
  $('#show-me').css('visibility', 'visible').animate({opacity: 1.0}, 2000);
});
</pre><br />
&nbsp;</p>
<p>Here is the complete example.<br />
<pre class="brush: xml;">
&lt;html&gt;
  &lt;head&gt;
    &lt;style type=&quot;text/css&quot;&gt;
      #show-me {
        visibility: hidden;
        opacity: 0.0;
      }
    &lt;/style&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
      $(document).ready(function() {
        $('#show-me').css('visibility', 'visible').animate({opacity: 1.0}, 2000);
      });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id=&quot;show-me&quot;&gt;
      &lt;a href=&quot;http://eureka.ykyuen.info&quot;&gt;Eureka!&lt;/a&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre><br />
&nbsp;</p>
<p>On the other hand, if you wanna hide an element, try the following example.<br />
<pre class="brush: xml;">
&lt;html&gt;
  &lt;head&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
      $(document).ready(function() {
        $('#hide-me').animate({opacity: 0.0}, 2000, setInvisble);
      });
      
      function setInvisble() {
        $('#hide-me').css('visibility', 'hidden');
      }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id=&quot;hide-me&quot;&gt;
      &lt;a href=&quot;http://eureka.ykyuen.info&quot;&gt;Eureka!&lt;/a&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre><br />
&nbsp;</p>
<p>Done =)</p>
<p>Reference: <a href="http://stackoverflow.com/questions/1031927/visibility-option-in-jquery" target="_blank">StackOverflow &#8211; Visibility option in jquery</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/jquery/'>jQuery</a> Tagged: <a href='http://eureka.ykyuen.info/tag/css/'>CSS</a>, <a href='http://eureka.ykyuen.info/tag/javascript/'>Javascript</a>, <a href='http://eureka.ykyuen.info/tag/jquery/'>jQuery</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10374/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10374&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/24/jquery-animation-on-visibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>Drupal 7 &#8211; Create a URL which display the latest node of a specific content type</title>
		<link>http://eureka.ykyuen.info/2012/05/23/drupal-7-create-a-url-which-display-the-latest-node-of-a-specific-content-type/</link>
		<comments>http://eureka.ykyuen.info/2012/05/23/drupal-7-create-a-url-which-display-the-latest-node-of-a-specific-content-type/#comments</comments>
		<pubDate>Wed, 23 May 2012 04:00:12 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[Drupal 7]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10721</guid>
		<description><![CDATA[I want to create a URL which will redirect to the latest node of a specific content type so i write a custom module. In this example, the content type car is used. latest_car.info &#160; latest_car.module &#160; Enable the module &#8230; <a href="http://eureka.ykyuen.info/2012/05/23/drupal-7-create-a-url-which-display-the-latest-node-of-a-specific-content-type/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10721&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I want to create a <font color="#008888">URL</font> which will redirect to the <font color="#008000">latest node</font> of a specific <font color="#0000FF">content type</font> so i write a <font color="#880088">custom module</font>. In this example, the <font color="#0000FF">content type</font> <font color="#FF8000">car</font> is used.</p>
<p><font color="#FF0000">latest_car.info</font><br />
<pre class="brush: plain;">
name = Latest car
description = Create a URL which will redirect to the latest car node.
package = Eureka;
version = 7.x-1.0
core = 7.x
</pre><span id="more-10721"></span><br />
&nbsp;</p>
<p><font color="#FF0000">latest_car.module</font><br />
<pre class="brush: php;">
&lt;?php

/**
 * Implements hook_menu()
 */
function latest_car_menu() {

  $items = array();

  $items['car'] = array(
    'title' =&gt; t('Car'),
    'page callback' =&gt; 'display_latest_car',
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_CALLBACK
  );

  return $items;
}

/**
 * Redirect to latest car node
 */
function display_latest_car() {
  // Get the latest node id of the car content type
  $query = new EntityFieldQuery();
  $query-&gt;entityCondition('entity_type', 'node')
    -&gt;entityCondition('bundle', 'car')
    -&gt;propertyCondition('status', 1)
    -&gt;propertyOrderBy('created', 'DESC')
    -&gt;range(0, 1);
  $result = $query-&gt;execute();
  
  if (isset($result['node'])) {
    // Rediret to the latest node page
    drupal_goto(drupal_lookup_path('alias', &quot;node/&quot; . key($result['node'])));
  } else {
    // Redirect to front page if the query returns no result
    drupal_set_message('Page not found', 'error');
    drupal_goto('&lt;front&gt;');
  }
}
</pre><br />
&nbsp;</p>
<p>Enable the module and then visit <font color="#008888">http://&lt;drupal&gt;/car</font>, you should be redirect to the <font color="#008000">latest car node page</font>.</p>
<p>Done =)</p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/cms/'>CMS</a> Tagged: <a href='http://eureka.ykyuen.info/tag/drupal/'>Drupal</a>, <a href='http://eureka.ykyuen.info/tag/drupal-7/'>Drupal 7</a>, <a href='http://eureka.ykyuen.info/tag/drupal-development/'>Drupal Development</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10721/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10721&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/23/drupal-7-create-a-url-which-display-the-latest-node-of-a-specific-content-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>Drupal 7 &#8211; Set Query Strings in the path for form_state[&#039;redirect&#039;]</title>
		<link>http://eureka.ykyuen.info/2012/05/22/drupal-7-set-query-strings-in-the-path-for-form_stateredirect/</link>
		<comments>http://eureka.ykyuen.info/2012/05/22/drupal-7-set-query-strings-in-the-path-for-form_stateredirect/#comments</comments>
		<pubDate>Tue, 22 May 2012 04:00:28 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[Drupal 7]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10629</guid>
		<description><![CDATA[Previously we talked about adding query strings for drupal_goto(). Drupal – Escape the Hex Characters in drupal_goto() When the form is submitted, we can decide the redirect path in the form_submit() function. Redirect to node/1 after form submission &#160; But &#8230; <a href="http://eureka.ykyuen.info/2012/05/22/drupal-7-set-query-strings-in-the-path-for-form_stateredirect/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10629&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Previously we talked about adding <font color="#FF8000">query strings</font> for <font color="#880088">drupal_goto()</font>.<br />
<a href="http://eureka.ykyuen.info/2011/05/11/drupal-escape-the-hex-characters-in-drupal_goto/" target="_blank">Drupal – Escape the Hex Characters in drupal_goto()</a></p>
<p>When the form is submitted, we can decide the <font color="#FF00FF">redirect path</font> in the <font color="#0000FF">form_submit()</font> function.<br />
<font color="#008000">Redirect to node/1 after form submission</font><br />
<pre class="brush: php;">
function &lt;form id&gt;_submit($form, &amp;$form_state) {
  $form_state['redirect'] = 'node/1'
}
</pre><br />
&nbsp;<br />
<span id="more-10629"></span></p>
<p>But if you want to redirect with <font color="#FF8000">query strings</font>, the following piece of code will <font color="#FF0000">NOT WORK</font>.<br />
<pre class="brush: php;">
function &lt;form id&gt;_submit($form, &amp;$form_state) {
  $form_state['redirect'] = 'node/1?abc=1&amp;def=2#ghk'
}
</pre><br />
&nbsp;</p>
<p>You will be redirected to <font color="#008888">node/1%3Fabc%3D1%26def%3D2%23ghk</font>. Here is the <font color="#0000FF">CORRECT</font> way to add <font color="#FF8000">query strings</font> in the <font color="#FF00FF">redirect path</font>.<br />
<pre class="brush: php;">
function &lt;form id&gt;_submit($form, &amp;$form_state) {
  $form_state['redirect'] = array(
    'node/1',
    array(
      'query' =&gt; array(
        'abc' =&gt; '1',
        'def' =&gt; '2'
      ),
      'fragment' =&gt; 'ghk',
    ),
  );
}
</pre><br />
&nbsp;</p>
<p>Done =)</p>
<p>Reference: <a href="http://drupal.org/node/291680" target="_blank">Drupal forum &#8211; Redirecting with query string</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/cms/'>CMS</a> Tagged: <a href='http://eureka.ykyuen.info/tag/drupal/'>Drupal</a>, <a href='http://eureka.ykyuen.info/tag/drupal-7/'>Drupal 7</a>, <a href='http://eureka.ykyuen.info/tag/drupal-development/'>Drupal Development</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10629/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10629&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/22/drupal-7-set-query-strings-in-the-path-for-form_stateredirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>.htaccess &#8211; Deny access for a specific folder under webroot</title>
		<link>http://eureka.ykyuen.info/2012/05/21/htaccess-deny-access-for-a-specific-folder-under-webroot/</link>
		<comments>http://eureka.ykyuen.info/2012/05/21/htaccess-deny-access-for-a-specific-folder-under-webroot/#comments</comments>
		<pubDate>Mon, 21 May 2012 04:00:17 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10749</guid>
		<description><![CDATA[We can deny the access for a specific folder in webroot. Create the following .htaccess file in that restrictive folder. &#160; All access from other IPs are denied except for 127.0.0.1. Done =) Reference: .htaccess: Deny From All – Prohibit, &#8230; <a href="http://eureka.ykyuen.info/2012/05/21/htaccess-deny-access-for-a-specific-folder-under-webroot/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10749&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We can <font color="#FF0000">deny</font> the <font color="#0000FF">access</font> for a specific folder in <font color="#FF8000">webroot</font>. Create the following <font color="#008000">.htaccess</font> file in that <font color="#FF00FF">restrictive folder</font>.<br />
<pre class="brush: plain;">
order deny,allow
deny from all
allow from 127.0.0.1
</pre><br />
&nbsp;</p>
<p>All <font color="#0000FF">access</font> from other IPs are <font color="#FF0000">denied</font> except for <font color="#880088">127.0.0.1</font>.</p>
<p>Done =)</p>
<p>Reference: <a href="http://www.kavoir.com/2009/01/htaccess-deny-from-all-restrict-directory-access.html" target="_blank">.htaccess: Deny From All – Prohibit, Forbid or Restrict Directory Access</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/apache/'>Apache</a> Tagged: <a href='http://eureka.ykyuen.info/tag/htaccess/'>.htaccess</a>, <a href='http://eureka.ykyuen.info/tag/apache/'>Apache</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10749/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10749&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/21/htaccess-deny-access-for-a-specific-folder-under-webroot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>CSS3 &#8211; Smooth the text in WebKit browser after Text Rotation by activating the anti-aliasing</title>
		<link>http://eureka.ykyuen.info/2012/05/20/css3-smooth-the-text-in-webkit-browser-after-text-rotation-by-activating-the-anti-aliasing/</link>
		<comments>http://eureka.ykyuen.info/2012/05/20/css3-smooth-the-text-in-webkit-browser-after-text-rotation-by-activating-the-anti-aliasing/#comments</comments>
		<pubDate>Sun, 20 May 2012 04:00:29 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Gecko]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10434</guid>
		<description><![CDATA[Text rotation can be done by CSS3 3D Transforms. But after the transform the text is aliased. For WebKit browser, the anti-aliasing feature could be enabled by adding the following CSS style. &#160; Here is the updated example from CSS3 &#8230; <a href="http://eureka.ykyuen.info/2012/05/20/css3-smooth-the-text-in-webkit-browser-after-text-rotation-by-activating-the-anti-aliasing/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10434&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font color="#FF0000">Text rotation</font> can be done by <font color="#FF00FF">CSS3</font> <font color="#0000FF">3D Transforms</font>. But after the transform the text is <font color="#008888">aliased</font>. For <font color="#008000">WebKit</font> browser, the <font color="#880088">anti-aliasing</font> feature could be enabled by adding the following <font color="#FF00FF">CSS</font> style.<br />
<pre class="brush: css;">
  * {
    -webkit-transform: translate3d(0,0,0);
  }
</pre><span id="more-10434"></span><br />
&nbsp;</p>
<p>Here is the updated example from <a href="http://eureka.ykyuen.info/2012/05/19/css3-text-rotation-by-3d-transforms/" target="_blank">CSS3 &#8211; Text Rotation by 3D Transforms</a><br />
<pre class="brush: xml;">
&lt;html&gt;
  &lt;head&gt;
    &lt;style type=&quot;text/css&quot;&gt;
      #rotate {
        -webkit-transform: rotate(-5deg);
        -moz-transform: rotate(-5deg);
        -ms-transform: rotate(-5deg);
        -o-transform: rotate(-5deg);
        background-color: #6C6;
        font-family: Arial;
      }
      
      * {
        -webkit-transform: translate3d(0,0,0);
      }
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;p id=&quot;rotate&quot;&gt;&lt;span&gt;Eureka!&lt;/span&gt;&lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre><br />
&nbsp;</p>
<p>Check it out again~<br />
<a href="http://ykyuen.files.wordpress.com/2012/04/css3-rotate-webkit-anti-aliasing.png"><img src="http://ykyuen.files.wordpress.com/2012/04/css3-rotate-webkit-anti-aliasing.png?w=584" alt="" title="css3-rotate-webkit-anti-aliasing"   class="aligncenter size-full wp-image-10436" /></a></p>
<p>For <font color="#FF0000">Firefox</font> which uses the <font color="#8A0808">Gecko</font> engine, the <font color="#880088">anti-aliasing</font> is enabled by default but the effect varies among different <font color="#FF0000">Firefox</font> versions.</p>
<p>For <font color="#008888">Internet Explorer</font>, <strong>LET&#8217;S FORGET ABOUT IT. =P</strong></p>
<p>Done =)</p>
<p>Reference: <a href="http://stackoverflow.com/questions/8605194/improve-css3-text-rotation-quality" target="_blank">StackOverflow &#8211; Improve css3 text rotation quality</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/css/'>CSS</a>, <a href='http://eureka.ykyuen.info/category/css3/'>CSS3</a> Tagged: <a href='http://eureka.ykyuen.info/tag/chrome/'>Chrome</a>, <a href='http://eureka.ykyuen.info/tag/css/'>CSS</a>, <a href='http://eureka.ykyuen.info/tag/css3/'>CSS3</a>, <a href='http://eureka.ykyuen.info/tag/firefox/'>Firefox</a>, <a href='http://eureka.ykyuen.info/tag/gecko/'>Gecko</a>, <a href='http://eureka.ykyuen.info/tag/internet-explorer/'>Internet Explorer</a>, <a href='http://eureka.ykyuen.info/tag/safari/'>Safari</a>, <a href='http://eureka.ykyuen.info/tag/webkit/'>WebKit</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10434/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10434&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/20/css3-smooth-the-text-in-webkit-browser-after-text-rotation-by-activating-the-anti-aliasing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>

		<media:content url="http://ykyuen.files.wordpress.com/2012/04/css3-rotate-webkit-anti-aliasing.png" medium="image">
			<media:title type="html">css3-rotate-webkit-anti-aliasing</media:title>
		</media:content>
	</item>
		<item>
		<title>CSS3 &#8211; Text Rotation by 3D Transforms</title>
		<link>http://eureka.ykyuen.info/2012/05/19/css3-text-rotation-by-3d-transforms/</link>
		<comments>http://eureka.ykyuen.info/2012/05/19/css3-text-rotation-by-3d-transforms/#comments</comments>
		<pubDate>Sat, 19 May 2012 04:19:31 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10430</guid>
		<description><![CDATA[Next: CSS3 – Smooth the text in WebKit browser after Text Rotation by activating the anti-aliasing We can rotate text by using the CSS3 transform. To rotate a text in clockwise direction with 45 degree: &#160; Here is an example &#8230; <a href="http://eureka.ykyuen.info/2012/05/19/css3-text-rotation-by-3d-transforms/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10430&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Next: <a href="http://eureka.ykyuen.info/2012/05/20/css3-smooth-the-text-in-webkit-browser-after-text-rotation-by-activating-the-anti-aliasing/" target="_blank">CSS3 – Smooth the text in WebKit browser after Text Rotation by activating the anti-aliasing<br />
</a><br />
We can <font color="FF0000">rotate text</font> by using the <font color="FF00FF">CSS3</font> <font color="0000FF">transform</font>.</p>
<p>To <font color="FF0000">rotate a text</font> in <font color="008000">clockwise</font> direction with <font color="FF8000">45 degree</font>:<br />
<pre class="brush: css;">
p {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
}
</pre><br />
&nbsp;<br />
<span id="more-10430"></span><br />
Here is an example which demonstrates <font color="FF0000">text rotation</font>.<br />
<pre class="brush: xml;">
&lt;html&gt;
  &lt;head&gt;
    &lt;style type=&quot;text/css&quot;&gt;
      #rotate {
        -webkit-transform: rotate(-5deg);
        -moz-transform: rotate(-5deg);
        -ms-transform: rotate(-5deg);
        -o-transform: rotate(-5deg);
        background-color: #6C6;
        font-family: Arial;
      }
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;p id=&quot;rotate&quot;&gt;&lt;span&gt;Eureka!&lt;/span&gt;&lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre><br />
&nbsp;</p>
<p>Check it out~<br />
<a href="http://ykyuen.files.wordpress.com/2012/04/css3-rotate.png"><img src="http://ykyuen.files.wordpress.com/2012/04/css3-rotate.png?w=584" alt="" title="css3-rotate"   class="aligncenter size-full wp-image-10431" /></a><br />
&nbsp;</p>
<p>Done =)</p>
<p>Reference: <a href="http://www.w3schools.com/css3/css3_3dtransforms.asp" target="_blank">W3Schools &#8211; CSS3 3D Transforms</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/css/'>CSS</a>, <a href='http://eureka.ykyuen.info/category/css3/'>CSS3</a> Tagged: <a href='http://eureka.ykyuen.info/tag/css/'>CSS</a>, <a href='http://eureka.ykyuen.info/tag/css3/'>CSS3</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10430/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10430&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/19/css3-text-rotation-by-3d-transforms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>

		<media:content url="http://ykyuen.files.wordpress.com/2012/04/css3-rotate.png" medium="image">
			<media:title type="html">css3-rotate</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery &#8211; Get the CSS value without the px unit</title>
		<link>http://eureka.ykyuen.info/2012/05/18/jquery-get-the-css-value-without-the-px-unit/</link>
		<comments>http://eureka.ykyuen.info/2012/05/18/jquery-get-the-css-value-without-the-px-unit/#comments</comments>
		<pubDate>Fri, 18 May 2012 04:00:59 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10670</guid>
		<description><![CDATA[When we use jQuery to retrieve the CSS values such as width and height, the unit px is included. For example, if you have a div which is 100px wide. &#160; Call .css() to get the width value. &#160; But &#8230; <a href="http://eureka.ykyuen.info/2012/05/18/jquery-get-the-css-value-without-the-px-unit/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10670&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When we use <font color="#880088">jQuery</font> to retrieve the <font color="#FF00FF">CSS</font> values such as <font color="#0000FF">width</font> and <font color="#FF8000">height</font>, the unit <font color="#008000">px</font> is included.</p>
<p>For example, if you have a <font color="#FF0000">div</font> which is 100<font color="#008000">px</font> wide.<br />
<pre class="brush: xml;">
&lt;div id=&quot;eureka&quot; style=&quot;width: 100px;&quot;&gt;&lt;/div&gt;
</pre><span id="more-10670"></span><br />
&nbsp;</p>
<p>Call <font color="#FF00FF">.css()</font> to get the width value.<br />
<pre class="brush: jscript;">
$('#eureka').css('width'); // Return '100px'
</pre><br />
&nbsp;</p>
<p>But most of the time we would like to have a <font color="#008888">numeric</font> value rather than a <font color="#8A0808">string</font>. Here comes the <font color="#008888">numeric</font> solution.<br />
<pre class="brush: jscript;">
parseFloat($('#eureka').css('width')); // Return 100
</pre><br />
&nbsp;</p>
<p>You don&#8217;t need to worry about the unit <font color="#0000FF">em</font>. This is because <font color="#FF00FF">.css()</font> must return the value in unit <font color="#008000">px</font>.</p>
<p>Done =)</p>
<p>Reference: </p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/css/'>CSS</a>, <a href='http://eureka.ykyuen.info/category/jquery/'>jQuery</a> Tagged: <a href='http://eureka.ykyuen.info/tag/css/'>CSS</a>, <a href='http://eureka.ykyuen.info/tag/javascript/'>Javascript</a>, <a href='http://eureka.ykyuen.info/tag/jquery/'>jQuery</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10670/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10670&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/18/jquery-get-the-css-value-without-the-px-unit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>Drupal 7 &#8211; Add the latest jQuery on your Drupal 7 without conflicts</title>
		<link>http://eureka.ykyuen.info/2012/05/17/drupal-7-add-the-latest-jquery-on-your-drupal-7-without-conflicts/</link>
		<comments>http://eureka.ykyuen.info/2012/05/17/drupal-7-add-the-latest-jquery-on-your-drupal-7-without-conflicts/#comments</comments>
		<pubDate>Thu, 17 May 2012 04:00:08 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[Drupal 7]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=10726</guid>
		<description><![CDATA[A few months ago, i tried to add the latest jQuery to a Drupal 6 website. If you are still working on Drupal 6. Please refer to Drupal – Add Extra jQuery Library. The approach we used in the above &#8230; <a href="http://eureka.ykyuen.info/2012/05/17/drupal-7-add-the-latest-jquery-on-your-drupal-7-without-conflicts/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10726&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few months ago, i tried to add the latest <font color="#880088">jQuery</font> to a <font color="#0000FF">Drupal 6</font> website. If you are still working on <font color="#0000FF">Drupal 6</font>. Please refer to <a href="http://eureka.ykyuen.info/2011/11/30/drupal-add-extra-jquery-library/" target="_blank">Drupal – Add Extra jQuery Library</a>.</p>
<p>The approach we used in the above post does not work in <font color="#0000A0">Drupal 7</font> since <font color="#FF0000">drupal_set_html_head()</font> has been renamed to <font color="#008000">drupal_add_html_head()</font> and inline <font color="#FF8000">Javascript</font> is no longer supported in this new version. So today i would like to show you another solution which works in <font color="#0000A0">Drupal 7</font>.<br />
<span id="more-10726"></span><br />
The most straight forward way to add the <font color="#880088">jQuery</font> is to edit the <font color="#FF00FF">html.tpl.php</font> directly. To avoid conflict with the <font color="#880088">jQuery</font> provided by <font color="#0000FF">Drupal</font>, we need to add it new one before <font color="#0000FF">Drupal</font> one. Here is the <font color="#FF00FF">html.tpl.php</font> of <font color="#008888">Omega</font> theme.</p>
<p><font color="#FF00FF">html.tpl.php</font><br />
<pre class="brush: xml;">
&lt;?php print $doctype; ?&gt;
&lt;html lang=&quot;&lt;?php print $language-&gt;language; ?&gt;&quot; dir=&quot;&lt;?php print $language-&gt;dir; ?&gt;&quot;&lt;?php print $rdf-&gt;version . $rdf-&gt;namespaces; ?&gt;&gt;
&lt;head&lt;?php print $rdf-&gt;profile; ?&gt;&gt;
  &lt;?php print $head; ?&gt;
  &lt;title&gt;&lt;?php print $head_title; ?&gt;&lt;/title&gt;  
  &lt;?php print $styles; ?&gt;

  &lt;!-- *** Extra jQuery - START *** --&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
      var $j = jQuery.noConflict();
    &lt;/script&gt;
  &lt;!-- *** Extra jQuery -  END  *** --&gt;

  &lt;!-- *** Other JS libs - START *** --&gt;
  &lt;!--
    Add other jQuery libs which you want to use with the above latest jQuery.
  --&gt;
  &lt;!-- *** Other JS libs -  END  *** --&gt;

  &lt;!-- Default drupal js files --&gt;
  &lt;?php print $scripts; ?&gt;
  &lt;!--[if lt IE 9]&gt;&lt;script src=&quot;http://html5shiv.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;&lt;![endif]--&gt;
&lt;/head&gt;
&lt;body&lt;?php print $attributes;?&gt;&gt;
  &lt;div id=&quot;skip-link&quot;&gt;
    &lt;a href=&quot;#main-content&quot; class=&quot;element-invisible element-focusable&quot;&gt;&lt;?php print t('Skip to main content'); ?&gt;&lt;/a&gt;
  &lt;/div&gt;
  &lt;?php print $page_top; ?&gt;
  &lt;?php print $page; ?&gt;
  &lt;?php print $page_bottom; ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre><br />
&nbsp;</p>
<p>Check if it works in <font color="#008000">Chrome</font>.<br />
<a href="http://ykyuen.files.wordpress.com/2012/05/drupal-7-add-latest-jquery.png"><img src="http://ykyuen.files.wordpress.com/2012/05/drupal-7-add-latest-jquery.png?w=584&h=171" alt="" title="drupal-7-add-latest-jquery" width="584" height="171" class="aligncenter size-full wp-image-10727" /></a><br />
&nbsp;</p>
<p>I found that for those <font color="#FF0000">3rd party Javascript</font> libs which are included in the <font color="#FF8000">&lt;theme&gt;.info</font>, they cannot be used with the latest <font color="#880088">jQuery</font>. The workaround is to include those libs right after the latest <font color="#880088">jQuery</font> include statement as shown in the <font color="#FF00FF">html.tpl.php</font>.</p>
<p>And for the <font color="#008000">custom Javascript</font> files which are included in the <font color="#FF8000">&lt;theme&gt;.info</font>. You can use both <font color="#880088">jQuery</font> as shown below.<br />
<pre class="brush: jscript;">
// Use latest jQuery
$j(function($){
  $(document).ready(function(){
    alert($().jquery);
  });
});

// Use Drupal jQuery
(function($){
  $(document).ready(function(){
    alert($().jquery);
  });
})(jQuery);
</pre><br />
&nbsp;</p>
<p>Done =)</p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/cms/'>CMS</a> Tagged: <a href='http://eureka.ykyuen.info/tag/drupal/'>Drupal</a>, <a href='http://eureka.ykyuen.info/tag/drupal-7/'>Drupal 7</a>, <a href='http://eureka.ykyuen.info/tag/drupal-development/'>Drupal Development</a>, <a href='http://eureka.ykyuen.info/tag/jquery/'>jQuery</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/10726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/10726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ykyuen.wordpress.com/10726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ykyuen.wordpress.com/10726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ykyuen.wordpress.com/10726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ykyuen.wordpress.com/10726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ykyuen.wordpress.com/10726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ykyuen.wordpress.com/10726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ykyuen.wordpress.com/10726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ykyuen.wordpress.com/10726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ykyuen.wordpress.com/10726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ykyuen.wordpress.com/10726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ykyuen.wordpress.com/10726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ykyuen.wordpress.com/10726/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=10726&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2012/05/17/drupal-7-add-the-latest-jquery-on-your-drupal-7-without-conflicts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>

		<media:content url="http://ykyuen.files.wordpress.com/2012/05/drupal-7-add-latest-jquery.png" medium="image">
			<media:title type="html">drupal-7-add-latest-jquery</media:title>
		</media:content>
	</item>
	</channel>
</rss>
