loading
Please wait while loading...

Read more Simple animation using CSS3

CSS3 provide a simple way to make animation from one style to another without using flash or javascript. The easy way you do is add a transition attribute in the starting style. Below show a simple example:

#top_menu li a {
	color: #FFF;
	padding: 5px 10px;
	border-radius: 10px;
	text-decoration: none;

	-webkit-transition: all 300ms linear;
	-moz-transition: all 300ms linear;
	-o-transition: all 300ms linear;
}
#top_menu li a:hover {
	background-color: #F9C;
	color: #09F;
}

The result you can refer to the top menu on this page by using firefox or chrome.

Read more A useful function in MySQL - GROUP_CONCAT

Table1

t_id code name
1 PM123 Hello
2 PM456 Hello2

 

Table2

id t_id value
1 1 something1
2 1 something2
3 1 something3
4 2 baby1
5 2 baby2

 

I want to get a result as following:

t_id code name value value value
1 PM123 Hello something1 something2 something3
2 PM456 Hello2 baby1 baby2  

 

In this case, if we use LEFT JOIN the result will fetch to 5 columns data, if we use GROUP BY, it can come back with 2 columns of data but the row "value" can only come up with either 1 value of the grouped row due the order priority. So, how can we make the expected result?

...........

Read more Difference between $(window).load() & $(document).ready()

When we using jQuery, we would always call $(document).ready(function() { } ). However, document.ready is only prvoide for load script when the DOM is ready. If you want to show your page when all the element is ready (Such as make a loading screen), then you would suggested to use $(window).load() which is the same as window.load on js. This would run your code after all element include images, frames are loaded.

Read more A fix for the iOS orientationchange zoom bug

Place the following javscript in your document head.

<script>
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
/*! A fix for the iOS orientationchange zoom bug. Script by @scottjehl, rebound by @wilto.MIT / GPLv2 License.*/(function(a){function m(){d.setAttribute("content",g),h=!0}function n(){d.setAttribute("content",f),h=!1}function o(b){l=b.accelerationIncludingGravity,i=Math.abs(l.x),j=Math.abs(l.y),k=Math.abs(l.z),(!a.orientation||a.orientation===180)&&(i>7||(k>6&&j<8||k<8&&j>6)&&i>5)?h&&n():h||m()}var b=navigator.userAgent;if(!(/iPhone|iPad|iPod/.test(navigator.platform)&&/OS [1-5]_[0-9_]* like Mac OS X/i.test(b)&&b.indexOf("AppleWebKit")>-1))return;var c=a.document;if(!c.querySelector)return;var d=c.querySelector("meta[name=viewport]"),e=d&&d.getAttribute("content"),f=e+",maximum-scale=1",g=e+",maximum-scale=10",h=!0,i,j,k,l;if(!d)return;a.addEventListener("orientationchange",m,!1),a.addEventListener("devicemotion",o,!1)})(this);
}
</script>

Read more Convert array of any depth to xml

Example php 5.2 code to convert array of any depth to xml document:

...........
1 2 3 4 5 6 7 8 9 10