<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

	<channel>

		
		<language>en</language>
		<title><![CDATA[Osvaldas Valutis &middot; Blog]]></title>
		<description><![CDATA[Web design, typography, user experience and front-end (HTML, CSS, JavaScript, jQuery) blog.]]></description>
		<link>http://osvaldas.info/</link>
		<category><![CDATA[Blog]]></category>
		<managingEditor><![CDATA[osvaldas@osvaldas.info]]></managingEditor>
		<generator><![CDATA[Osvaldas Valutis, http://osvaldas.info/]]></generator>
		<pubDate>Sun, 19 May 2013 21:14:26 +0300</pubDate>
		<lastBuildDate>Sun, 19 May 2013 21:14:26 +0300</lastBuildDate>

		<image>
			<url>http://osvaldas.info/theme/img/logo.png</url>
			<title><![CDATA[Osvaldas Valutis]]></title>
			<link>http://osvaldas.info/</link>
			<width />
			<height />
			<description><![CDATA[Web designer who thinks in code]]></description>
		</image>

		
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/OsvaldasValutisBlog" /><feedburner:info uri="osvaldasvalutisblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>OsvaldasValutisBlog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
			<title><![CDATA[Drop-Down Navigation: Responsive and Touch-Friendly]]></title>
			<description>&lt;p&gt;What if you need a multi-level navigation? In most cases, you design a &lt;strong&gt;drop-down&lt;/strong&gt;&amp;nbsp;menu using unordered lists. But what do you do&amp;nbsp;to make it usable on small and/or&amp;nbsp;&lt;strong&gt;cursorless&lt;/strong&gt;&amp;nbsp;screens? By &lt;em&gt;usable&lt;/em&gt; I mean being able to use hyperlinks on parental anchors and open them with a &lt;strong&gt;double-tap&lt;/strong&gt; (which is a native act on touch devices), also being able to close the drop-downs by tapping anywhere outside them to avoid flashing and other huge usability faults but having a usual bulletproof drop-down menu on desktop screens at the same time.&amp;nbsp;A while ago I came up with quite a simple technique. I&amp;nbsp;have been successfully implementing it into my projects as there is no room for one-sided techniques anymore.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Drop-Down Navigation: Responsive and Touch-Friendly" src="http://osvaldas.info/incoming/images/drop-down-navigation-touch-friendly-and-responsive-1.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;h2&gt;The Problem&lt;/h2&gt;
&lt;p&gt;...is a drop-down on touch screen because there is no cursor and you cannot hover on the navigation items! It gets even worse if you have links on parent menu items. Once you click them, the drop-down shows up for a second and then immediately disappears because the browser has just opened the link of an anchor you &lt;a href="http://stuffandnonsense.co.uk/blog/about/not-click.-not-tap.-not-select.-press" target="_blank"&gt;pressed&lt;/a&gt;! That sucks. As well as using &lt;em&gt;hash&lt;/em&gt; symbol for parental link &lt;code&gt;href&lt;/code&gt;&amp;#39;s: as a consequence, you cannot use normal URLs, the page sometimes may scroll up after the link is clicked, the drop-down may flash, you won&amp;#39;t be able to shut it off, etc. Sorry, that is not a problem anymore &amp;ndash; it is &lt;strong&gt;solved&lt;/strong&gt; in this post! Watch my very first video montage to get the idea:&lt;/p&gt;
&lt;p&gt;&lt;iframe allowfullscreen="" frameborder="0" height="400" mozallowfullscreen="" src="http://player.vimeo.com/video/63104740" webkitallowfullscreen="" width="100%"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p class="dimmed small" style="text-align: right;"&gt;Music audio by &lt;a href="mailto:honeyrec@gmail.com" target="_blank"&gt;DJ Betas&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Talking about responsiveness, there is a plenty, plenty of responsive navigation solutions out there. I admit, I have hardly gone deeper into any of these, but still my favorite one is David Bushell&amp;#39;s &lt;a href="http://coding.smashingmagazine.com/2013/01/15/off-canvas-navigation-for-responsive-website/" target="_blank"&gt;off-canvas&lt;/a&gt; navigation. It is awesome. However, as for my personal projects I fit the usual &lt;em&gt;one-button&lt;/em&gt;&amp;nbsp;responsive navigation &lt;a href="http://bradfrostweb.com/blog/web/responsive-nav-patterns/" target="_blank"&gt;pattern&lt;/a&gt;. The same one goes here as well.&lt;/p&gt;
&lt;h2&gt;Composition&lt;/h2&gt;
&lt;p&gt;The technique consists of three main parts:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Simple drop-down navigation based on HTML and CSS;&lt;/li&gt;
	&lt;li&gt;Responsiveness implementation using media queries;&lt;/li&gt;
	&lt;li&gt;Adoption for touch screen devices with the help of a super tiny jQuery plugin.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now about everything in turn&amp;hellip;&lt;/p&gt;
&lt;h2&gt;HTML and CSS drop-down navigation&lt;/h2&gt;
&lt;p&gt;Firstly, simple markup of multi-leveled unordered lists with a little bit of HTML5 flavor. My example consists of two levels. Two is not the limit, you may have infinite levels on your next super project.&lt;/p&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;nav id=&amp;quot;nav&amp;quot; role=&amp;quot;navigation&amp;quot;&amp;gt;
	&amp;lt;a href=&amp;quot;#nav&amp;quot; title=&amp;quot;Show navigation&amp;quot;&amp;gt;Show navigation&amp;lt;/a&amp;gt;
	&amp;lt;a href=&amp;quot;#&amp;quot; title=&amp;quot;Hide navigation&amp;quot;&amp;gt;Hide navigation&amp;lt;/a&amp;gt;
	&amp;lt;ul&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;
			&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;Blog&amp;lt;/a&amp;gt;
			&amp;lt;ul&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;Design&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;HTML&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;CSS&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;JavaScript&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
			&amp;lt;/ul&amp;gt;
		&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;
			&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;Work&amp;lt;/a&amp;gt;
			&amp;lt;ul&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;Web Design&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;Typography&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;Front-End&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
			&amp;lt;/ul&amp;gt;
		&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/&amp;quot;&amp;gt;About&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
	&amp;lt;/ul&amp;gt;
&amp;lt;/nav&amp;gt;&lt;/pre&gt;
&lt;p&gt;Now let&amp;#39;s just give a sense to the HTML above with the CSS below. Presenting only the principle parts of CSS. Full code&amp;nbsp;&amp;ndash; later in the demo.&lt;/p&gt;
&lt;p&gt;Do not be surprised by &lt;em&gt;Show / Hide navigation&lt;/em&gt; anchors. I am going to hide these for now using &lt;code style="white-space: nowrap;"&gt;#nav &amp;gt; a&lt;/code&gt; selector and flick on later in the next step.&lt;/p&gt;
&lt;pre class="brush:css;"&gt;#nav
{
	/* container */
}
	#nav &amp;gt; a
	{
		display: none;
	}
	#nav li
	{
		position: relative;
	}

	/* first level */

	#nav &amp;gt; ul
	{
		height: 3.75em;
	}
		#nav &amp;gt; ul &amp;gt; li
		{
			width: 25%;
			height: 100%;
			float: left;
		}

	/* second level */

	#nav li ul
	{
		display: none;
		position: absolute;
		top: 100%;
	}
		#nav li:hover ul
		{
			display: block;
		}&lt;/pre&gt;
&lt;p&gt;User interface behavior on non-touch screens is based on the result of&amp;nbsp;&lt;code&gt;position: relative&lt;/code&gt;&amp;nbsp;and &lt;code&gt;position: absolute&lt;/code&gt;&amp;nbsp;manipulation. On touchscreens it still fails at solving&amp;nbsp;&lt;em&gt;the problem&lt;/em&gt;, but we will make it right later in the 3&lt;sup&gt;rd&lt;/sup&gt; part of the post.&lt;/p&gt;
&lt;h2&gt;Responsive drop-down navigation&lt;/h2&gt;
&lt;p&gt;&lt;img alt="Drop-Down Navigation: Responsive and Touch-Friendly" class="on-left" src="http://osvaldas.info/incoming/images/drop-down-navigation-touch-friendly-and-responsive-2.jpg" /&gt;Let&amp;#39;s pour some responsiveness in. &lt;strong&gt;640 pixels&lt;/strong&gt;&amp;nbsp;is my choice for a major breakpoint at which with the help of a single media query, the navigation shrinks to &lt;strong&gt;a button&lt;/strong&gt;&amp;nbsp;(icon). Therefore, the menu can only be called out by pressing&amp;nbsp;the button.&lt;/p&gt;
&lt;pre class="brush:css;"&gt;@media only screen and ( max-width: 40em ) /* 640 */
{
	#nav
	{
		position: relative;
	}
		#nav &amp;gt; a
		{
		}
		#nav:not( :target ) &amp;gt; a:first-of-type,
		#nav:target &amp;gt; a:last-of-type
		{
			display: block;
		}

	/* first level */

	#nav &amp;gt; ul
	{
		height: auto;
		display: none;
		position: absolute;
		left: 0;
		right: 0;
	}
		#nav &amp;gt; ul.active
		{
			display: block;
		}
		#nav &amp;gt; ul &amp;gt; li
		{
			width: 100%;
			float: none;
		}

	/* second level */

	#nav li ul
	{
		position: static;
	}
}&lt;/pre&gt;
&lt;p&gt;CSS pseudo selector &lt;code&gt;:target&lt;/code&gt; makes it easy to toggle menu as the anchor&amp;#39;s &lt;code&gt;href&lt;/code&gt; attribute coincides with CSS &lt;code&gt;ID&lt;/code&gt; selector name. Therefore, as you might have understood, the first anchor of &lt;code&gt;#nav &amp;gt; a&lt;/code&gt; is responsible for showing and the second for hiding the menu.&lt;/p&gt;
&lt;h2&gt;Touch-friendly drop-down navigation&lt;/h2&gt;
&lt;p&gt;&lt;img alt="Drop-Down Navigation: Responsive and Touch-Friendly" class="on-left" src="http://osvaldas.info/incoming/images/drop-down-navigation-touch-friendly-and-responsive-3.jpg" /&gt;The most important things go in the end: let&amp;#39;s finally solve the problem described in the very first paragraphs of the post. Here comes the promised super lightweight jQuery plugin which I called &lt;strong&gt;&lt;a href="http://osvaldas.info/examples/drop-down-navigation-touch-friendly-and-responsive/doubletaptogo.js" target="_blank"&gt;DoubleTapToGo.js&lt;/a&gt;&lt;/strong&gt;&amp;nbsp;and it is&amp;nbsp;only 550 ridiculous bytes in size when &lt;a href="http://osvaldas.info/examples/drop-down-navigation-touch-friendly-and-responsive/doubletaptogo.min.js" target="_blank"&gt;minified&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When you tap the parent item for the first time, DoubleTapToGo prevents the browser from opening a new URL but allows that if tapped once again &lt;em&gt;in succession&lt;/em&gt;. If there is an intermediate tap(s) between the first one and the second the counter resets. Quite simple principle of operation, isn&amp;#39;t it? It may be hard to believe but this solved all of the flaws I have mentioned before.&lt;/p&gt;
&lt;p&gt;Considering the markup above, the plugin should be only applied to the items that are &lt;strong&gt;parents&lt;/strong&gt;&amp;nbsp;&amp;ndash;&amp;nbsp;in order to avoid double-tap requirement on &lt;em&gt;drop-down-less&lt;/em&gt; items:&lt;/p&gt;
&lt;pre class="brush:jscript;"&gt;$( &amp;#39;#nav li:has(ul)&amp;#39; ).doubleTapToGo();&lt;/pre&gt;
&lt;p&gt;This is it! Complete fulfillment, full code and working example&amp;nbsp;&amp;ndash; all in the demo:&lt;/p&gt;
&lt;p&gt;&lt;a class="demo" href="http://osvaldas.info/examples/drop-down-navigation-touch-friendly-and-responsive/" target="_blank"&gt;Demo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Be sure to test it on your &lt;strong&gt;smartphone&lt;/strong&gt; or &lt;strong&gt;tablet&amp;nbsp;&lt;/strong&gt;&amp;ndash; type this into the address bar: &lt;em&gt;osvaldas.info/u/tnav&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Final words&lt;/h2&gt;
&lt;p&gt;I have ran tests on both Mac and Windows versions of the latest Chrome, Safari, Firefox and Opera browsers as well as on IE9+, Safari of iOS 6, Chrome of Android 2.2/4.2, IE9-10 of Windows Phone 7-8, Opera Mobile. Worked everywhere as it should.&lt;/p&gt;
&lt;p&gt;As always, looking forward to getting a feedback from you in the comments or via &lt;a href="http://twitter.com/osvaldas" target="_blank"&gt;@osvaldas&lt;/a&gt;.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=W7rMDIKDQms:npfo98ine9w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=W7rMDIKDQms:npfo98ine9w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=W7rMDIKDQms:npfo98ine9w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=W7rMDIKDQms:npfo98ine9w:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=W7rMDIKDQms:npfo98ine9w:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=W7rMDIKDQms:npfo98ine9w:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=W7rMDIKDQms:npfo98ine9w:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/W7rMDIKDQms" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/W7rMDIKDQms/drop-down-navigation-responsive-and-touch-friendly</link>
			<guid isPermaLink="false">http://osvaldas.info/drop-down-navigation-responsive-and-touch-friendly</guid>
			<comments>http://osvaldas.info/drop-down-navigation-responsive-and-touch-friendly#comments</comments>

			
			<category><![CDATA[Mobile]]></category>

			
			<category><![CDATA[Navigation]]></category>

			
			<category><![CDATA[Touch]]></category>

			
			<category><![CDATA[HTML]]></category>

			
			<category><![CDATA[Responsive]]></category>

			
			<category><![CDATA[jQuery]]></category>

			
			<category><![CDATA[JavaScript]]></category>

			
			<category><![CDATA[CSS]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_drop-down-navigation-responsive-and-touch-friendly.jpg" type="image/jpeg" length="9268" />

			
			<author><![CDATA[Osvaldas Valutis]]></author>

			
			<pubDate>Tue, 02 Apr 2013 14:22:08 +0300</pubDate>
		<feedburner:origLink>http://osvaldas.info/drop-down-navigation-responsive-and-touch-friendly</feedburner:origLink></item>

		
		<item>
			<title><![CDATA[Audio Player: Responsive and Touch-Friendly]]></title>
			<description>&lt;p&gt;A couple of months ago I built a jQuery plugin that replaces &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; element with a little of custom HTML code. By adding some CSS you get a whole new player which looks the way you want and has the same functionality as the default player. There is no direct way to style the element. But the HTML5 DOM has methods, properties, and events for the element and thus makes it quite easily manipulable.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://osvaldas.info/examples/audio-player-responsive-and-touch-friendly/" target="_blank"&gt;&lt;img alt="Audio Player: Responsive and Touch-Friendly" src="http://osvaldas.info/incoming/images/blog/audio-player-responsive-and-touch-friendly-1.jpg" style="width: 760px; height: 380px; " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To sum it up, &lt;strong&gt;the plugin enables indirect styling of &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; element.&lt;/strong&gt; That&amp;#39;s why I built it. I wanted the player to fit the design theme for one of my present projects &amp;ndash; IP &lt;a href="http://kalbu.lt" target="_blank"&gt;telephony for business&lt;/a&gt; (VOIP). The audio element serves for IVR (Interactive Voice Response) function where clients can built their own voice responders / menus, make audio records and rehear them.&lt;/p&gt;
&lt;p&gt;A couple of weeks ago I wrote an in-depth article about the plugin for &lt;a href="http://tympanus.net/codrops/2012/12/04/responsive-touch-friendly-audio-player/" target="_blank"&gt;Codrops&lt;/a&gt;, which I recommend for people who think of themselves as less experienced in the field. Receiving some helpful feedback there, helped me to improve the player. Obviously, this is not the end and I will be looking for your feedback here as well.&lt;/p&gt;
&lt;h2&gt;Features&lt;/h2&gt;
&lt;p&gt;Before deciding to build a plugin on my own, I did a little research on existing alternatives. I had clear and strict requirements: &lt;strong&gt;(1)&lt;/strong&gt; it must be lightweight, customizable and &lt;em&gt;right&lt;/em&gt;; &lt;strong&gt;(2)&lt;/strong&gt; it must solve contemporary problems like &lt;em&gt;touch&lt;/em&gt; and &lt;em&gt;responsive;&lt;/em&gt; &lt;strong&gt;(3)&lt;/strong&gt; it must not solve problems &lt;a href="http://rachelandrew.co.uk/archives/2012/03/21/stop-solving-problems-you-dont-yet-have/" target="_blank"&gt;I don&amp;#39;t have yet&lt;/a&gt;. However, nothing passed through the filter. As the matter of fact, the player I built is:&lt;/p&gt;
&lt;ul style=""&gt;
	&lt;li&gt;&lt;strong&gt;Responsive.&lt;/strong&gt;&lt;br /&gt;To achieve this, full responsibility falls on your CSS. My example is responsive. You can have a non-responsive player as well, but that is not recommended. &lt;em&gt;Responsiveness&lt;/em&gt; is an important sign of a &lt;em&gt;good&lt;/em&gt; web experience.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Touchable.&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;Touchableness&lt;/em&gt; is an important sign of a good web experience as well. Having these two, you are device and screen independent. And that is a half job done!&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Adaptive.&lt;/strong&gt;&lt;br /&gt;When the browser does not support the audio element entirely or any of the provided audio files, the player then gracefully degrades to a one-button (&lt;em&gt;Play/Pause&lt;/em&gt; buttons only) &lt;code&gt;&amp;lt;embed /&amp;gt;&lt;/code&gt; element based player which will use a third party plugin (mostly Quick Time on Mac, Windows Media Player on Windows) to play the audio file. Another possible scenario: JavaScript disabled in the browser. Browser&amp;#39;s default player takes action then. And that is totally fine.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Native.&lt;/strong&gt;&lt;br /&gt;The player is in no way &lt;em&gt;directly&lt;/em&gt; native. The plugin accepts audio element&amp;#39;s attributes (&lt;code&gt;src&lt;/code&gt;, &lt;code&gt;autoplay&lt;/code&gt;, &lt;code&gt;loop&lt;/code&gt;, &lt;code&gt;preoload&lt;/code&gt;) and tags (&lt;code&gt;&amp;lt;source&amp;gt;&lt;/code&gt;). Besides that, &amp;quot;autoplay&amp;quot; and &amp;quot;loop&amp;quot; attributes are inherited on the previously mentioned fallback case.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Usable.&lt;/strong&gt;&lt;br /&gt;The essential &lt;em&gt;Play / Pause&lt;/em&gt; and playback progress controls, &lt;em&gt;Volume On / Off / Up / Down&lt;/em&gt; controls and indication of how much of the audio is preloaded (buffered).&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Image-less.&lt;/strong&gt;&lt;br /&gt;This depends on your CSS as well. The looks of my player is all CSS, not a single image file used. Having that and sizing everything with &lt;code&gt;em&lt;/code&gt; units, enables the player to be scaled and zoomed.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Flash-less.&lt;/strong&gt;&lt;br /&gt;So long, Flash. You are unwanted here.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=""&gt;
	&lt;li&gt;&lt;strong&gt;Lightness.&lt;/strong&gt;&lt;br /&gt;The minified version of the plugin is just &lt;strong&gt;4KB&lt;/strong&gt; &lt;del&gt;large&lt;/del&gt; small.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;Add the audio element, set the attributes you need and add source(s). The more different sources you add, the more users will be able to listen to your audio (because none of the audio formats are supported across all browsers). Three examples:&lt;/p&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;audio src=&amp;quot;audio.wav&amp;quot; preload=&amp;quot;auto&amp;quot; controls&amp;gt;&amp;lt;/audio&amp;gt;&lt;/pre&gt;
&lt;p&gt;This will just preload the &lt;code&gt;audio.wav&lt;/code&gt; file and won&amp;#39;t play it until user clicks &lt;em&gt;Play&lt;/em&gt; button. Other &lt;code&gt;preload&lt;/code&gt; values (&lt;code&gt;none&lt;/code&gt;, &lt;code&gt;metadata&lt;/code&gt;) will not preload the file.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;autoplay&lt;/code&gt; the file when it loads and then &lt;code&gt;loop&lt;/code&gt; it in this way:&lt;/p&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;audio src=&amp;quot;audio.wav&amp;quot; preload=&amp;quot;auto&amp;quot; controls autoplay loop&amp;gt;&amp;lt;/audio&amp;gt;&lt;/pre&gt;
&lt;p&gt;Specify multiple audio formats to solve the previously mentioned problem:&lt;/p&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;audio preload=&amp;quot;auto&amp;quot; controls&amp;gt;
	&amp;lt;source src=&amp;quot;audio.wav&amp;quot; /&amp;gt;
	&amp;lt;source src=&amp;quot;audio.mp3&amp;quot; /&amp;gt;
	&amp;lt;source src=&amp;quot;audio.ogg&amp;quot; /&amp;gt;
&amp;lt;/audio&amp;gt;&lt;/pre&gt;
&lt;p&gt;Mystic &lt;code&gt;controls&lt;/code&gt;? It is a boolean attribute which does not influence the plugin in any way, but ensures that browser&amp;#39;s default player is displayed and displayed with controls when JavaScript is disabled.&lt;/p&gt;
&lt;p&gt;The final step &amp;ndash; calling the plugin (by including jQuery and the plugin files in the document if that hasn&amp;#39;t been done previously) on the audio element:&lt;/p&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;audio src=&amp;quot;audio.wav&amp;quot; preload=&amp;quot;auto&amp;quot; controls&amp;gt;&amp;lt;/audio&amp;gt;
&amp;lt;script src=&amp;quot;jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&amp;quot;audioplayer.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
	$( function()
	{
		$( &amp;#39;audio&amp;#39; ).audioPlayer();
	});
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;The plugin has some optional parameters. The most important one is called &lt;code&gt;classPrefix&lt;/code&gt;. The passed value becomes a class name for the parent element and class name prefix for child elements. Other options may only be advantageous for languages other than English. Example with default values:&lt;/p&gt;
&lt;pre class="brush:jscript;"&gt;$( &amp;#39;audio&amp;#39; ).audioPlayer(
{
	classPrefix: &amp;#39;audioplayer&amp;#39;,
	strPlay: &amp;#39;Play&amp;#39;,
	strPause: &amp;#39;Pause&amp;#39;,
	strVolume: &amp;#39;Volume&amp;#39;
});&lt;/pre&gt;
&lt;h2&gt;HTML&lt;/h2&gt;
&lt;p&gt;As I mentioned in the very first paragraph, when the plugin is called, the &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; element is replaced then with some HTML:&lt;/p&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;div class=&amp;quot;audioplayer audioplayer-stopped&amp;quot;&amp;gt;
	&amp;lt;audio src=&amp;quot;audio.wav&amp;quot; preload=&amp;quot;auto&amp;quot; controls&amp;gt;&amp;lt;/audio&amp;gt;
	&amp;lt;div class=&amp;quot;audioplayer-playpause&amp;quot; title=&amp;quot;Play&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Play&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
	&amp;lt;div class=&amp;quot;audioplayer-time audioplayer-time-current&amp;quot;&amp;gt;00:00&amp;lt;/div&amp;gt;
	&amp;lt;div class=&amp;quot;audioplayer-bar&amp;quot;&amp;gt;
		&amp;lt;div class=&amp;quot;audioplayer-bar-loaded&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
		&amp;lt;div class=&amp;quot;audioplayer-bar-played&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
	&amp;lt;/div&amp;gt;
	&amp;lt;div class=&amp;quot;audioplayer-time audioplayer-time-duration&amp;quot;&amp;gt;&amp;amp;hellip;&amp;lt;/div&amp;gt;
	&amp;lt;div class=&amp;quot;audioplayer-volume&amp;quot;&amp;gt;
		&amp;lt;div class=&amp;quot;audioplayer-volume-button&amp;quot; title=&amp;quot;Volume&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Volume&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
		&amp;lt;div class=&amp;quot;audioplayer-volume-adjust&amp;quot;&amp;gt;&amp;lt;div&amp;gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;
	&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;There are some class names, which are assigned to the &lt;strong&gt;parent&lt;/strong&gt; element when:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;audioplayer-playing&lt;/em&gt; &amp;ndash; audio is being played:&lt;br /&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;audioplayer audioplayer-playing&amp;quot;&amp;gt;&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;audioplayer-stopped&lt;/em&gt; &amp;ndash; audio is being stopped:&lt;br /&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;audioplayer audioplayer-stopped&amp;quot;&amp;gt;&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;audioplayer-muted&lt;/em&gt; &amp;ndash; volume is muted:&lt;br /&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;audioplayer audioplayer-muted&amp;quot;&amp;gt;&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;audioplayer-novolume&lt;/em&gt; &amp;ndash; no volume adjustment is available:&lt;br /&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;audioplayer audioplayer-novolume&amp;quot;&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; when the audio element is not supported or none of the given audio files are compatible with the browser, the player switches to &lt;em&gt;Mini&lt;/em&gt; mode, which basically reduces the player to &lt;em&gt;Play/Pause&lt;/em&gt; button (because &amp;quot;embed&amp;quot; element is limited in terms of manipulation):&lt;/p&gt;
&lt;pre class="brush:html"&gt;&amp;lt;div class=&amp;quot;audioplayer audioplayer-stopped audioplayer-mini&amp;quot;&amp;gt;
	&amp;lt;embed src=&amp;quot;audio.wav&amp;quot; width=&amp;quot;0&amp;quot; height=&amp;quot;0&amp;quot; volume=&amp;quot;100&amp;quot; autostart=&amp;quot;false&amp;quot; loop=&amp;quot;false&amp;quot; /&amp;gt;
	&amp;lt;div class=&amp;quot;audioplayer-playpause&amp;quot; title=&amp;quot;Play&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Play&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;u&gt;Reminder:&lt;/u&gt; using &lt;code&gt;classPrefix&lt;/code&gt; options on the initiation of the plugin you can replace every &lt;code&gt;audioplayer&lt;/code&gt; occurrence with your own value in the HTML and so to have different looks of multiple players on the same website.&lt;/p&gt;
&lt;p&gt;Now, everything depends on how you will style the player using CSS. I will skip this part here and go directly to demo, but you can read &lt;a href="http://tympanus.net/codrops/2012/12/04/responsive-touch-friendly-audio-player" target="_blank"&gt;my article on Codrops&lt;/a&gt; about the styling anytime.&lt;/p&gt;
&lt;h2&gt;Demo&lt;/h2&gt;
&lt;p&gt;As mentioned hundreds of times before, my player is &lt;em&gt;responsive&lt;/em&gt; and isn&amp;#39;t even dependent on Media Queries. I have a made a scheme which explains the layout:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Audio Player: Responsive and Touch-Friendly" src="http://osvaldas.info/incoming/images/blog/audio-player-responsive-and-touch-friendly-2.jpg" style="width: 760px; height: 380px; " /&gt;&lt;/p&gt;
&lt;p&gt;The parent element &lt;code&gt;.audioplayer&lt;/code&gt; is &lt;code&gt;position: relative;&lt;/code&gt; whereas the child elements &lt;code&gt;.audioplayer-*&lt;/code&gt; are &lt;code&gt;position: absolute;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a class="demo" href="http://osvaldas.info/examples/audio-player-responsive-and-touch-friendly" target="_blank"&gt;Demo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Grab the plugin: &lt;a href="http://osvaldas.info/examples/audio-player-responsive-and-touch-friendly/audioplayer.js" target="_blank"&gt;audioplayer.js&lt;/a&gt; (uncompressed; 8KB) &lt;em&gt;or&lt;/em&gt; &lt;a href="http://osvaldas.info/examples/audio-player-responsive-and-touch-friendly/audioplayer.min.js"&gt;audioplayer.min.js&lt;/a&gt; (minified; 4KB).&lt;/p&gt;
&lt;h2&gt;Feedback&lt;/h2&gt;
&lt;p&gt;I tested the player and it works fine on the latest Safari, Chrome, Firefox, Opera both Mac and Windows versions. The player works well on Internet Explorer 9, 10 and gracefully degrades to mini mode on earlier versions. I have also been lucky with iOS 6, Windows Phone 7 and Android 4.2 default browsers. However, the &lt;em&gt;earlier&lt;/em&gt; Android versions does not support &amp;quot;audio&amp;quot; nor &amp;quot;embed&amp;quot; elements, so the player won&amp;#39;t work there at all.&lt;/p&gt;
&lt;p&gt;What was your experience, got any thoughts, insights or built your own look? Feel free to send me a &lt;a href="http://twitter.com/osvaldas" target="_blank"&gt;tweet&lt;/a&gt; or leave a comment below. Thanks!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;P.S.&lt;/em&gt; do not confuse the plugin with the media centre or so. It was not built to have playlists or display album covers.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=GM9JKzaVohI:-O4TvzQaFUA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=GM9JKzaVohI:-O4TvzQaFUA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=GM9JKzaVohI:-O4TvzQaFUA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=GM9JKzaVohI:-O4TvzQaFUA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=GM9JKzaVohI:-O4TvzQaFUA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=GM9JKzaVohI:-O4TvzQaFUA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=GM9JKzaVohI:-O4TvzQaFUA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/GM9JKzaVohI" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/GM9JKzaVohI/audio-player-responsive-and-touch-friendly</link>
			<guid isPermaLink="false">http://osvaldas.info/audio-player-responsive-and-touch-friendly</guid>
			<comments>http://osvaldas.info/audio-player-responsive-and-touch-friendly#comments</comments>

			
			<category><![CDATA[Mobile]]></category>

			
			<category><![CDATA[Media]]></category>

			
			<category><![CDATA[Touch]]></category>

			
			<category><![CDATA[HTML]]></category>

			
			<category><![CDATA[Responsive]]></category>

			
			<category><![CDATA[jQuery]]></category>

			
			<category><![CDATA[JavaScript]]></category>

			
			<category><![CDATA[CSS]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_audio-player-responsive-and-touch-friendly.jpg" type="image/jpeg" length="31711" />

			
			<author><![CDATA[Osvaldas Valutis]]></author>

			
			<pubDate>Thu, 27 Dec 2012 14:26:55 +0200</pubDate>
		<feedburner:origLink>http://osvaldas.info/audio-player-responsive-and-touch-friendly</feedburner:origLink></item>

		
		<item>
			<title><![CDATA[Responsive jQuery Masonry]]></title>
			<description>&lt;p&gt;&amp;hellip;or Pinterest-style layout.&amp;nbsp;&lt;a href="http://masonry.desandro.com" target="_blank"&gt;jQuery Masonry&lt;/a&gt; is a jQuery-based plugin for a dynamic grid layout built by &lt;a href="http://twitter.com/desandro" target="_blank"&gt;David DeSandro&lt;/a&gt;. What it does is &lt;em&gt;&amp;ldquo;arranges elements vertically, positioning each element in the next open spot in the grid&amp;rdquo;&lt;/em&gt; and what you get is &lt;em&gt;&amp;ldquo;minimized vertical gaps between elements of &lt;strong&gt;varying height&lt;/strong&gt;&amp;rdquo;&lt;/em&gt;. Sounds too higgledy-piggledy? Remember the social network you quit a while ago because of the &lt;em&gt;obvious&lt;/em&gt; reasons, whereas your wife/girlfriend still uses it on a daily basis and you can&amp;#39;t get her off from this? Bull&amp;#39;s eye, that&amp;#39;s &lt;a href="http://pinterest.com" target="_blank"&gt;Pinterest&lt;/a&gt;.&amp;nbsp;So this time, as said before, Pinterest-style layout made &lt;a href="http://osvaldas.info/responsive"&gt;responsive&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://sheepy.me" target="_blank"&gt;&lt;img alt="Responsive jQuery Masonry" src="http://osvaldas.info/incoming/images/blog/responsive-jquery-masonry-1.jpg" style="width: 760px; height: 385px; " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://sheepy.me" target="_blank"&gt;Sheepy Me&lt;/a&gt; is a website where I constantly combine time-tested techniques and new trends. As for the blog where pictures act big in both ways, Pinterest inspired layout (a trend, popularized by Pinterest) probably was the best choice for listing items attractively. Although, JavaScript-based layout is not a good practice and should be avoided while CSS is capable to do this instead. This time, so far, it&amp;#39;s not. Will take a look closer at this later in the post anyway.&lt;/p&gt;
&lt;p&gt;jQuery Masonry is not the only plugin and method for achieving the same effect, but it was the one actually working as well as working in the way I prefer. In &lt;em&gt;responsive&lt;/em&gt; way. We&amp;#39;re at the nice times when not thinking &lt;em&gt;responsively&lt;/em&gt; is a bad habit and &lt;em&gt;non-responsive&lt;/em&gt; techniques are considered as, to put it mildly, poor ones. jQuery Masonry is responsive-friendly, but that&amp;#39;s not enough and some extra work is necessary in order to make it all meaningful.&lt;/p&gt;
&lt;h2&gt;The Grid&lt;/h2&gt;
&lt;p&gt;Three-column grid is when screen width is higher than 640 pixels. Two columns &amp;ndash; when screen width is equal to or less than 640 pixels, but is more than 320 pixels. And one column &amp;ndash; when screen width is equal to or less than 320 pixels. The scheme may be easily adjusted to any other manner.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://osvaldas.info/examples/responsive-jquery-masonry-or-pinterest-style-layout"&gt;&lt;img alt="Responsive jQuery Masonry" src="http://osvaldas.info/incoming/images/blog/responsive-jquery-masonry-2.jpg" style="width: 760px; height: 480px; " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Setting It Up&lt;/h2&gt;
&lt;p&gt;Apart from the obvious &lt;em&gt;include-&lt;a href="http://jquery.com" target="_blank"&gt;jQuery&lt;/a&gt;-first&lt;/em&gt;, let&amp;#39;s see how actual things look like before bringing them to the world of &lt;em&gt;responsiveness&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt; structure is the simplest thing here. The further content goes into &lt;code&gt;.item&lt;/code&gt; elements. Thinking of better semantics, it would be nicer to go with unordered list. At Sheepy Me I used &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;&amp;#39;s for comments, date and tags to present into &lt;code&gt;.item&lt;/code&gt;&amp;#39;s. To avoid any conflict and keep CSS clean, &lt;code&gt;div&lt;/code&gt;&amp;#39;s was the only choice.&lt;/p&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;div id=&amp;quot;wrapper&amp;quot;&amp;gt;
	&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;
		&amp;lt;div class=&amp;quot;item&amp;quot;&amp;gt; ... &amp;lt;/div&amp;gt;
		&amp;lt;div class=&amp;quot;item&amp;quot;&amp;gt; ... &amp;lt;/div&amp;gt;
		&amp;lt;div class=&amp;quot;item&amp;quot;&amp;gt; ... &amp;lt;/div&amp;gt;
		&amp;lt;!-- ... --&amp;gt;
	&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt; is a little bit more specific as it puts our layout to &lt;em&gt;fluid&lt;/em&gt; mode. Instead of ritual &lt;code&gt;px&lt;/code&gt;, I use &lt;code&gt;em&lt;/code&gt; (based on browser&amp;#39;s default size &lt;code&gt;16px&lt;/code&gt;, &lt;code&gt;100%&lt;/code&gt;) and &lt;code&gt;%&lt;/code&gt; to define sizes and so to achieve complete flexibility across the browsers, screen sizes and &lt;a href="http://stackoverflow.com/a/657632" target="_blank"&gt;people habits&lt;/a&gt;.&lt;/p&gt;
&lt;pre class="brush:css;"&gt;#wrapper
{
	max-width: 60em; /* 960 px */
	margin: 0 auto;
}
	#list
	{
		width: 103.125%; /* 990px */
		overflow: hidden;
		margin-left: -1.562%; /* 15px */
		margin-bottom: -1.875em; /* 30px */
	}
		.item
		{
			width: 30.303%; /* 300px */
			float: left;
			margin: 0 1.515% 1.875em; /* 15px 30px */ 
		}
&lt;/pre&gt;
&lt;p&gt;What&amp;#39;s interesting, I did a small workaround to solve the problem of horizontal margins by setting the width of &lt;code&gt;#list&lt;/code&gt; to more than 100% and left margin to the negative value. Though jQuery Masonry manages horizontal spacing automatically, the workaround gracefully degrades when JavaScript is disabled in the browser.&lt;/p&gt;
&lt;p&gt;Finally some&amp;nbsp;&lt;strong&gt;JavaScript&lt;/strong&gt;.&amp;nbsp;Only shameless initialization of the plugin for now.&lt;/p&gt;
&lt;pre class="brush:jscript;"&gt;$( window ).load( function()
{
	$( &amp;#39;#list&amp;#39; ).masonry( { itemSelector: &amp;#39;.item&amp;#39; } );
});&lt;/pre&gt;
&lt;h2&gt;Pouring In Responsiveness&lt;/h2&gt;
&lt;p&gt;Now that we have a working formation, let&amp;#39;s teach it to adapt to savage environments: small and constantly changing screen sizes as well as zooming without remorse. However, the zoom is not handled well enough due to the absence of bulletproof active zooming detection.&lt;/p&gt;
&lt;p&gt;HTML stays the same, but &lt;strong&gt;CSS&lt;/strong&gt; code gets a makeup&amp;nbsp;&amp;ndash; &lt;em&gt;media queries&lt;/em&gt;. The first of them&amp;nbsp;transforms the grid to two-column one, whilst the second to the simple one-column layout.&lt;/p&gt;
&lt;pre class="brush:css;"&gt;#wrapper
{
	max-width: 60em; /* 960 px */
	margin: 0 auto;
}
	#list
	{
		width: 103.125%; /* 990px */
		overflow: hidden;
		margin-left: -1.562%; /* 15px */
		margin-bottom: -1.875em; /* 30px */
	}
		.item
		{
			width: 30.303%; /* 300px */
			float: left;
			margin: 0 1.515% 1.875em; /* 15px 30px */ 
		}

@media only screen and ( max-width: 40em ) /* 640px */
{
	.item
	{
		width: 46.876%; /* 305px */
		margin-bottom: 0.938em; /* 15px */
	}
}
@media only screen and ( max-width: 20em ) /* 640px */
{
	#list
	{
		width: 100%;
		margin-left: 0;
	}
		.item
		{
			width: 100%;
			margin-left: 0;
			margin-right: 0;
		}
}&lt;/pre&gt;
&lt;p&gt;What&amp;#39;s for &lt;strong&gt;JavaScript&lt;/strong&gt;, function &lt;code&gt;setColumns();&lt;/code&gt;&amp;nbsp;initially counts the number of columns accordingly to the screen width. &lt;code&gt;$( window ).resize( setColumns );&lt;/code&gt;&amp;nbsp;does the same, but when window is resized. jQuery Masonry, luckily, has an option named&amp;nbsp;&lt;code&gt;columnWidth&lt;/code&gt;. Putting under (for value) a function actually solves the problem.&lt;/p&gt;
&lt;pre class="brush:jscript;"&gt;$( window ).load( function()
{
	var columns	   = 3,
		setColumns = function() { columns = $( window ).width() &amp;gt; 640 ? 3 : $( window ).width() &amp;gt; 320 ? 2 : 1; };

	setColumns();
	$( window ).resize( setColumns );

	$( &amp;#39;#list&amp;#39; ).masonry(
	{
		itemSelector: &amp;#39;.item&amp;#39;,
		columnWidth:  function( containerWidth ) { return containerWidth / columns; }
	});
});&lt;/pre&gt;
&lt;p&gt;That&amp;#39;s it!&amp;nbsp;&lt;a href="http://sheepy.me" target="_blank"&gt;Sheepy Me&lt;/a&gt;&amp;nbsp;is a real life example of the whole experience. Besides that, I made a separate demo which consists only of the relevant code and helps to focus on the technique itself.&lt;/p&gt;
&lt;p&gt;&lt;a class="demo" href="http://osvaldas.info/examples/responsive-jquery-masonry-or-pinterest-style-layout" target="_blank"&gt;Demo&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;CSS-only solution?&lt;/h2&gt;
&lt;p&gt;Kushagra Agarwal &lt;a href="http://cssdeck.com/labs/css-only-pinterest-style-columns-layout" target="_blank"&gt;suggests&lt;/a&gt; to do without JavaScript and use CSS&amp;#39;s &lt;code&gt;column-*&lt;/code&gt;&amp;nbsp;properties instead. So how CSS code would change? &lt;code&gt;#wrapper&lt;/code&gt; remains the same, but the rest:&lt;/p&gt;
&lt;pre class="brush:css;"&gt;#list
{
	width: 100%;
	overflow: hidden;
	margin-bottom: -1.875em; /* 30px */
	-webkit-column-count: 3;
	-webkit-column-gap: 1.875em; /* 30px */
	-webkit-column-fill: auto;
	-moz-column-count: 3;
	-moz-column-gap: 1.875em; /* 30px */
	-moz-column-fill: auto;
	column-count: 3;
	column-gap: 1.875em; /* 30px */
	column-fill: auto;
}
	.item
	{
		margin-bottom: 1.875em; /* 15px 30px */
		-webkit-column-break-inside: avoid;
		-moz-column-break-inside: avoid;
		column-break-inside: avoid;
	}

@media only screen and ( max-width: 40em ) /* 640px */
{
	#list
	{
		-webkit-column-count: 2;
		-webkit-column-gap: 0.938em; /* 15px */
		-moz-column-count: 2;
		-moz-column-gap: 0.938em; /* 15px */
		column-count: 2;
		column-gap: 0.938em; /* 15px */
	}
		.item
		{
			margin-bottom: 0.938em; /* 15px */
		}
}
@media only screen and ( max-width: 20em ) /* 320px */
{
	#list
	{
		-webkit-column-count: auto;
		-moz-column-count: auto;
		column-count: auto;
	}
}&lt;/pre&gt;
&lt;p&gt;&lt;a class="demo" href="http://osvaldas.info/examples/responsive-pinterest-style-layout-with-css/" target="_blank"&gt;Demo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;How lovely is that, even with those &lt;em&gt;vendor prefixes&lt;/em&gt;. It would absolutely be the best technique, if it hadn&amp;#39;t the following limitations:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Not supported by IE9 and below;&lt;/li&gt;
	&lt;li&gt;Different rendering among supported browsers. Safari and Chrome does in one way, whilst Firefox and Opera in another. And both manners doesn&amp;#39;t seem to be logical enough.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;column-*&lt;/code&gt;&amp;nbsp;isn&amp;#39;t fully standardized yet across web browsers. jQuery Masonry is a JavaScript thing. Two evils. You can stay with just one of them. You can combine them, by attaching jQuery Masonry only to&amp;nbsp;&lt;em&gt;IE9-and-below&lt;/em&gt;&amp;nbsp;or &lt;em&gt;JavaScript-less&lt;/em&gt; users and applying CSS columns for the rest. Whichever your decision is, just make sure it&amp;#39;s best for your users.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=MoISOPSPGPg:t46hTeOJJrs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=MoISOPSPGPg:t46hTeOJJrs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=MoISOPSPGPg:t46hTeOJJrs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=MoISOPSPGPg:t46hTeOJJrs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=MoISOPSPGPg:t46hTeOJJrs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=MoISOPSPGPg:t46hTeOJJrs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=MoISOPSPGPg:t46hTeOJJrs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/MoISOPSPGPg" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/MoISOPSPGPg/responsive-jquery-masonry-or-pinterest-style-layout</link>
			<guid isPermaLink="false">http://osvaldas.info/responsive-jquery-masonry-or-pinterest-style-layout</guid>
			<comments>http://osvaldas.info/responsive-jquery-masonry-or-pinterest-style-layout#comments</comments>

			
			<category><![CDATA[Layout]]></category>

			
			<category><![CDATA[Grid]]></category>

			
			<category><![CDATA[Responsive]]></category>

			
			<category><![CDATA[jQuery]]></category>

			
			<category><![CDATA[JavaScript]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_responsive-jquery-masonry-or-pinterest-style-layout.jpg" type="image/jpeg" length="25820" />

			
			<pubDate>Tue, 18 Sep 2012 10:41:35 +0300</pubDate>
		<feedburner:origLink>http://osvaldas.info/responsive-jquery-masonry-or-pinterest-style-layout</feedburner:origLink></item>

		
		<item>
			<title><![CDATA[A Book Apart: Design Is A Job]]></title>
			<description>&lt;p&gt;The book &lt;em&gt;&lt;a href="http://www.abookapart.com/products/design-is-a-job" target="_blank"&gt;Design Is A Job&lt;/a&gt;&lt;/em&gt; is not the first book from that wonderful&amp;nbsp;&lt;em&gt;A Book Apart&lt;/em&gt;&amp;nbsp;collection I have read. But it&amp;#39;s the book from the whole series that I want to talk about first, because it analyzes a different aspect of &lt;em&gt;design&lt;/em&gt; as a profession, as a daily bread. Your design is useless if you are unable to sell it, if you can&amp;#39;t convince people that your solutions are in the right place and at the right time. So finally there comes &lt;a href="https://twitter.com/Mike_FTW" target="_blank"&gt;Mike Monteiro&lt;/a&gt;&amp;nbsp;from &lt;em&gt;Mule Design&lt;/em&gt; to tell you how to do that and shares his best from 11 years experience.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A Book Apart: Design Is A Job" src="http://osvaldas.info/incoming/images/posts/blog/a-book-apart-design-is-a-job-1.jpg" style="width: 760px; height: 250px; " /&gt;&lt;/p&gt;
&lt;p&gt;First of, this book was not written for people who expected 137 pages of wish-wash how clients are bad and how they want to suck you till the last drop of blood. Vice versa, the author would repeat himself a few times that &lt;em&gt;&amp;quot;there are no bad clients&amp;quot;&lt;/em&gt; and you, you are the one and only blacksmith of your own fortune.&amp;nbsp;I was lucky enough to notice &lt;a href="https://twitter.com/irishstu/status/240923833354297344" target="_blank"&gt;one&lt;/a&gt; of 400 million made-per-day-tweets (2012 statistics ) with this perfect statement which perfectly closes this completely vacuous topic: &amp;quot;&lt;em&gt;a lot of &amp;#39;&lt;a href="http://clientsfromhell.net" target="_blank"&gt;clients from hell&lt;/a&gt;&amp;#39; are &amp;#39;designers who fail to communicate&amp;#39;&amp;quot;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Reading the very first paragraphs may make a false impression. Personally, I found the 1&lt;sup&gt;st&lt;/sup&gt; chapter a little bit prosaic. Luckily, it was just the first one and then things got far more entertaining. I think the author would agree that it wasn&amp;#39;t very exciting, but it was necessary and a correct way to start this victorious&amp;nbsp;&lt;em&gt;b&amp;eacute;n&amp;eacute;fice&lt;/em&gt;. While the foreword writer &lt;a href="https://en.twitter.com/espiekermann" target="_blank"&gt;Erik Spiekermann&lt;/a&gt; describes the author as &lt;em&gt;&amp;quot;a living bullshit detector&amp;quot;&lt;/em&gt;, I&amp;#39;d add that Mike should turn his studio into a mediation-of-&lt;em&gt;designer-to-client&lt;/em&gt; agency which, I have no doubt, would be leading agency in the field. Probably because Mike did not completely move away from &lt;em&gt;making things&lt;/em&gt;&amp;nbsp;and&amp;nbsp;did not dedicate himself to clients. He stayed somewhere in the middle, successfully balancing between two sides.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A Book Apart: Design Is A Job" src="http://osvaldas.info/incoming/images/posts/blog/a-book-apart-design-is-a-job-2.jpg" style="width: 760px; height: 460px; " /&gt;&lt;/p&gt;
&lt;p&gt;Analyzing clients takes the lion&amp;#39;s share of the book. From the very first handshake or phone call, to finally paying for work. Mike &lt;a href="http://vimeo.com/22053820" target="_blank"&gt;does not&lt;/a&gt; wrap the words in wool. He writes in style. Here&amp;#39;s a classic situation how to smell the ruse:&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;You know that douchebag at the bar who walks up to your friends and says &amp;quot;You know, I usually date models...&amp;quot;. Yeah, that guy. The client services version of that is &amp;quot;You know, we&amp;#39;ve got some really big name agencies who&amp;#39;d love to get this job&amp;quot;. Great, go call them. Don&amp;#39;t work for someone who tries to make you feel they&amp;#39;re lowering themselves to work with you, even as negotiation tactic. Good work comes from mutual respect.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Having said that, Mike also perceives how important self-treatment is. If you do not respect yourself, no one else will. Designers, first of all, are thinkers, innovators and so problem solvers. Technical work is the last thing you need to do.&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;Beware of clients who have waited to call you until they have a perfect diagram of what they need and want you to color it in. If they&amp;#39;re not coming to you for strategy and problem-solving, they&amp;#39;re not coming to you for design, they&amp;#39;re coming to you for production. And if you take on production work, you don&amp;#39;t get to call yourself a designer.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I would exclude the 7&lt;sup&gt;th&lt;/sup&gt; chapter as the most important for me personally. I will read it every time (until I finally memorize it word by word) before presenting my work to clients. Presenting your work in a room could be a crucial moment.&amp;nbsp;Coincidence or not, but I had been watching&amp;nbsp;&lt;a href="http://www.amctv.com/shows/mad-men" target="_blank"&gt;Mad Men&lt;/a&gt;&amp;nbsp;series and reading this book at the same time. At some point, it was like watching this book based movie. Double effect.&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;Stop trying to get your clients to &amp;quot;understand design&amp;quot; and instead show them that you understand what they hired you to do. Explain how choices you&amp;#39;ve made lead to a successful project.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Something that is obvious but not always visible &amp;ndash; I remember myself being this immature:&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;Don&amp;#39;t waste client&amp;#39;s time walking them through what they can already see. Your job is to explain how what they&amp;#39;re looking at is the best way to achieve their goals.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img alt="A Book Apart: Design Is A Job" src="http://osvaldas.info/incoming/images/posts/blog/a-book-apart-design-is-a-job-3.jpg" style="width: 760px; height: 460px; " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Design Is A Job&lt;/em&gt; could be useful at every aspect of your professional life. Well, obviously, except pushing pixels and writing a markup. It&amp;#39;s perfect if you are a freelancer or own an agency. It&amp;#39;s still great if you work at agency. It&amp;#39;s&amp;nbsp;indispensable if you build websites. It&amp;#39;s still relevant if you make logos or do other graphic work. &lt;strong&gt;Recommended.&lt;/strong&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=KLqHnw2CyrU:geNdi1kxjqA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=KLqHnw2CyrU:geNdi1kxjqA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=KLqHnw2CyrU:geNdi1kxjqA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=KLqHnw2CyrU:geNdi1kxjqA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=KLqHnw2CyrU:geNdi1kxjqA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=KLqHnw2CyrU:geNdi1kxjqA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=KLqHnw2CyrU:geNdi1kxjqA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/KLqHnw2CyrU" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/KLqHnw2CyrU/a-book-apart-design-is-a-job</link>
			<guid isPermaLink="false">http://osvaldas.info/a-book-apart-design-is-a-job</guid>
			<comments>http://osvaldas.info/a-book-apart-design-is-a-job#comments</comments>

			
			<category><![CDATA[Books & Magazines]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_a-book-apart-design-is-a-job.jpg" type="image/jpeg" length="31751" />

			
			<author><![CDATA[Osvaldas Valutis]]></author>

			
			<pubDate>Mon, 03 Sep 2012 12:24:41 +0300</pubDate>
		<feedburner:origLink>http://osvaldas.info/a-book-apart-design-is-a-job</feedburner:origLink></item>

		
		<item>
			<title><![CDATA[Gestures-Sensitive Slideshow: Responsive and Touch-Friendly]]></title>
			<description>&lt;p&gt;I&amp;#39;m not quite sure, but it was probably 2006 (correct me if I&amp;#39;m wrong) when with the birth of jQuery the very first non-Flash slideshows/sliders appeared on Web. Before that time, writing JavaScript was a horrible pain and therefore websites were boring, Internet wasn&amp;#39;t that attractive as it is nowadays. Because nobody wanted to spend a week writing a thousand-lines code just to have something that does not work properly on any browser! Luckily, things have changed: JavaScript had become practical and that had heavily influenced the whole craft. Now things have changed even more: you can&amp;#39;t ignore mobile &amp;amp; tablet devices, you &lt;em&gt;must&lt;/em&gt; have your content &lt;a href="http://dbushell.com/2012/03/03/forget-about-browser-support/" target="_blank"&gt;accessible&lt;/a&gt; on any modern device.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;a href="http://osvaldas.info/examples/gestures-sensitive-slideshow-responsive-and-touch-friendly/" target="_blank"&gt;&lt;img alt="Gestures-Sensitive Slideshow: Responsive and Touch Friendly" src="http://osvaldas.info/incoming/images/blog/gestures-sensitive-slideshow-responsive-and-touch-friendly.jpg" style="width: 100%; " /&gt;&lt;/a&gt;&lt;/i&gt;&lt;/p&gt;
&lt;h2&gt;The Problem&lt;/h2&gt;
&lt;p&gt;While working on a client project called &lt;a href="http://dizainovirtuve.lt/interjero-dizainas" target="_blank"&gt;Dizaino Virtuvė&lt;/a&gt;&amp;nbsp;(&lt;em&gt;Design Kitchen&lt;/em&gt;), I wanted to present interior portfolio in appealing and more appropriate way than what usually resides under the &lt;em&gt;slideshow&lt;/em&gt; term. Not to mention accessibility on &lt;em&gt;touch&lt;/em&gt; devices. So I thought: after all, moving mouse or sliding finger on screen is much easier than clicking or tapping arrows for dozens of times, right? &lt;em&gt;Voila!&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;The Solution&lt;/h2&gt;
&lt;p&gt;The technique is based on some lines of &lt;strong&gt;HTML&lt;/strong&gt;, &lt;strong&gt;CSS&lt;/strong&gt;, JavaScript and (whole)&amp;nbsp;&lt;strong&gt;jQuery&lt;/strong&gt; framework. Unlike &lt;a href="http://osvaldas.info/blog/elegant-css-and-jquery-tooltip-responsive-mobile-friendly" target="_blank"&gt;responsive and touch-friendly tooltip&lt;/a&gt;, I made it plugin-like so that you can call plenty of the slideshow instances from wherever you want.&lt;/p&gt;
&lt;p&gt;Notice that the slideshow is &lt;em&gt;returning&amp;nbsp;&lt;/em&gt;what means anchors do not perform their primary function on &lt;em&gt;touch&lt;/em&gt; devices. Consequently, this type of slideshow may not fit in every situation. Anyway, if you have a specific purpose, as it is in my case, the technique should serve well.&lt;/p&gt;
&lt;h2&gt;HTML&lt;/h2&gt;
&lt;p&gt;The structure couldn&amp;#39;t be simpler: container and unordered list. What about content? It&amp;#39;s totally up to your imagination: it could be anything from pure images to tables. An example with images:&lt;/p&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;div id=&amp;quot;slideshow&amp;quot;&amp;gt;
	&amp;lt;ul&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;img src=&amp;quot;1.jpg&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;img src=&amp;quot;2.jpg&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;img src=&amp;quot;3.jpg&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;img src=&amp;quot;4.jpg&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;img src=&amp;quot;5.jpg&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/li&amp;gt;
	&amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;h2&gt;CSS&lt;/h2&gt;
&lt;p&gt;I think you have just felt what the CSS code is like only by looking at the HTML above, but just in case, here&amp;#39;s what to start with:&lt;/p&gt;
&lt;pre class="brush:css;"&gt;#slideshow
{
	width: 100%;
	height: 500px; /* slideshow height */
	overflow: hidden;
	position: relative; /* or absolute, but not static */
}
	#slideshow ul
	{
		width: 9999%;
		height: 100%;
		position: absolute;
		top: 0;
		left: 0;
	}
		#slideshow li
		{
			height: 100%;
			float: left;
			margin: 0 20px; /* spacing between items */
		}&lt;/pre&gt;
&lt;h2&gt;JavaScript&lt;/h2&gt;
&lt;p&gt;The plugin, actually, is very tiny, however, it has too many lines to paste them here. Paradox. So I made &lt;strong&gt;&lt;a href="http://osvaldas.info/incoming/examples/gestures-sensitive-slideshow-responsive-and-touch-friendly/gestured-slideshow.js" target="_blank"&gt;gestured-slideshow.js&lt;/a&gt;&lt;/strong&gt; available in the next tab of your browser.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no surprise you can call slideshow instance(s) in this way:&lt;/p&gt;
&lt;pre class="brush:jscript;"&gt;$( &amp;#39;#slideshow&amp;#39; ).gesturedSlideshow();&lt;/pre&gt;
&lt;p&gt;Captions, shadows, rounded borders, gradients, textures, animations and other loud phrases, for sure, are the way to style your next slideshow, but I decided to keep my demo calm and technique-focused. For that, for implementation and for more, check the demo, please:&lt;/p&gt;
&lt;p&gt;&lt;a class="demo" href="http://osvaldas.info/examples/gestures-sensitive-slideshow-responsive-and-touch-friendly" target="_blank"&gt;Demo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Wait, but what about a &lt;em&gt;non-returning&lt;/em&gt; slideshow? Yes, hopefully in one of my further posts! If you&amp;#39;ve got any thoughts on &lt;em&gt;returning&lt;/em&gt; one, feel free to share them: leave a comment or&amp;nbsp;&lt;a href="http://twitter.com/osvaldas" target="_blank"&gt;tweet&lt;/a&gt;&amp;nbsp;me.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=8NtRh8wBK5s:Ix21pkN2V7E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=8NtRh8wBK5s:Ix21pkN2V7E:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=8NtRh8wBK5s:Ix21pkN2V7E:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=8NtRh8wBK5s:Ix21pkN2V7E:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=8NtRh8wBK5s:Ix21pkN2V7E:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=8NtRh8wBK5s:Ix21pkN2V7E:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=8NtRh8wBK5s:Ix21pkN2V7E:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/8NtRh8wBK5s" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/8NtRh8wBK5s/gestures-sensitive-slideshow-responsive-and-touch-friendly</link>
			<guid isPermaLink="false">http://osvaldas.info/gestures-sensitive-slideshow-responsive-and-touch-friendly</guid>
			<comments>http://osvaldas.info/gestures-sensitive-slideshow-responsive-and-touch-friendly#comments</comments>

			
			<category><![CDATA[Mobile]]></category>

			
			<category><![CDATA[Touch]]></category>

			
			<category><![CDATA[Slideshow]]></category>

			
			<category><![CDATA[HTML]]></category>

			
			<category><![CDATA[Responsive]]></category>

			
			<category><![CDATA[jQuery]]></category>

			
			<category><![CDATA[JavaScript]]></category>

			
			<category><![CDATA[CSS]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_gestures-sensitive-slideshow-responsive-and-touch-friendly.jpg" type="image/jpeg" length="33521" />

			
			<author><![CDATA[Osvaldas Valutis]]></author>

			
			<pubDate>Tue, 22 May 2012 22:34:00 +0300</pubDate>
		<feedburner:origLink>http://osvaldas.info/gestures-sensitive-slideshow-responsive-and-touch-friendly</feedburner:origLink></item>

		
		<item>
			<title><![CDATA[Offscreen. The people behind bits and pixels]]></title>
			<description>&lt;blockquote&gt;
	&lt;p&gt;As our industry grows up, many of us seem to forget the human side of digital. There still hides a story of real people behind every interface.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With this really nice idea and a real sentence,&amp;nbsp;&lt;a href="https://twitter.com/kaibrach" target="_blank"&gt;Kai Brach&lt;/a&gt;&amp;nbsp;starts the first issue of his magazine named &lt;a href="http://offscreenmag.com" target="_blank"&gt;Offscreen&lt;/a&gt;. The quote also explains what it is all about. It&amp;#39;s about people behind bits and pixels. And by word &lt;em&gt;people&lt;/em&gt; I mean not just people who design websites and other related digital products, but also designers who live in this and are deeply passionate about web &amp;amp; design. Therefore, it is even more interesting!&lt;/p&gt;
&lt;p&gt;&lt;img alt="Offscreen Magazine" src="http://osvaldas.info/incoming/images/blog/offscreen_magazine_1.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;The first thing which falls into eyes is that the magazine wasn&amp;#39;t printed on that cheap flashy thin paper. I did not expect this, because all of at least the web-related magazines that I bought before&amp;nbsp;&amp;ndash; were. So the feel of naturalness is probably the first thing which helps Offscreen to stand out from the rest. But this would be nothing without a good, really good content&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Offscreen Magazine" src="http://osvaldas.info/incoming/images/blog/offscreen_magazine_2.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;From the very first pages it becomes apparent how many people were included in writing, designing and making of this magazine: contributors, sponsors, interviewers. Therefore it isn&amp;#39;t a magazine of one person, but it&amp;#39;s more like a voice of community. May it be a paradox, but you won&amp;#39;t find no stupid advertisement or banner carelessly dropped on article to make it harder to read for you. &lt;em&gt;Advertise in style&lt;/em&gt;&amp;nbsp;&amp;ndash; that&amp;#39;s how external things are presented there.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Offscreen Magazine" src="http://osvaldas.info/incoming/images/blog/offscreen_magazine_3.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p class="small" style="text-align: right; "&gt;&lt;em&gt;The magazine itself is also an example of perfect typography, artistic graphic elements. A special attention is paid to small details.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Offscreen Magazine" src="http://osvaldas.info/incoming/images/blog/offscreen_magazine_4.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;Unique stories-interviews of individuals play the biggest role in the magazine. I did like that there were only a few people mentioned, who I knew and heard about their works before. Actually, first when I saw &lt;a href="http://simplebits.com" target="_blank"&gt;Dan Cederholm&lt;/a&gt;&amp;#39;s name on the front page, I thought this was going to be just another read about people I have already heard of. Nothing like that. From roughly 50 contributors I knew only 7 of them before. Now I know all fifty! Apart from interesting Dan&amp;#39;s shares about Dribbble, you will read not less interesting as well as funny stories about creator of Pictos &lt;a href="http://drewwilson.com" target="_blank"&gt;Drew Wilson&lt;/a&gt;, former interactive designer of Last.fm &lt;a href="http://hannahdonovan.com" target="_blank"&gt;Hannah Donovan&lt;/a&gt; and so on, and so on.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Offscreen Magazine" src="http://osvaldas.info/incoming/images/blog/offscreen_magazine_5.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;The magazine also presents some sections, such as&amp;nbsp;&lt;em&gt;A Day In The Life Of &lt;/em&gt;where few designers&amp;nbsp;reveal their&amp;nbsp;schedule of a usual workday; &lt;em&gt;On The Desk Of&lt;/em&gt;&amp;nbsp;where selected designer shows his/her most important stuff; etc. Looks like Offscreen has everything to be an exclusive journal in the field. It really has that cozy mood.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Offscreen Magazine" src="http://osvaldas.info/incoming/images/blog/offscreen_magazine_6.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p class="small" style="text-align: right; "&gt;&lt;em&gt;Lots of photos in the magazine makes it fresh and playful!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Offscreen Magazine" src="http://osvaldas.info/incoming/images/blog/offscreen_magazine_7.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;Offscreen is the latest read on paper I have recently read. I found it very interesting and looking forward to receiving the second issue when it comes out or,&amp;nbsp;&lt;a href="http://www.offscreenmag.com/issue2/" target="_blank"&gt;as said&lt;/a&gt;, in the middle of 2012. Because I enjoyed it so much, I decided to write this blog post and support this nice initiative of Kai in this way.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Offscreen Magazine" src="http://osvaldas.info/incoming/images/blog/offscreen_magazine_8.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;I would like to end up this humble review by quoting a thought I found in the page number nine:&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;Every time dad tells me his idea, it&amp;#39;s a reminder to step away from the machine and pay attention to the world.&lt;/p&gt;
	&lt;p class="author"&gt;Jack Cheng&lt;/p&gt;
&lt;/blockquote&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=lZKkvnl17n0:q3kcPI4cWQ4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=lZKkvnl17n0:q3kcPI4cWQ4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=lZKkvnl17n0:q3kcPI4cWQ4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=lZKkvnl17n0:q3kcPI4cWQ4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=lZKkvnl17n0:q3kcPI4cWQ4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=lZKkvnl17n0:q3kcPI4cWQ4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=lZKkvnl17n0:q3kcPI4cWQ4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/lZKkvnl17n0" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/lZKkvnl17n0/offscreen-magazine-the-people-behind-bits-and-pixels</link>
			<guid isPermaLink="false">http://osvaldas.info/offscreen-magazine-the-people-behind-bits-and-pixels</guid>
			<comments>http://osvaldas.info/offscreen-magazine-the-people-behind-bits-and-pixels#comments</comments>

			
			<category><![CDATA[Books & Magazines]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_offscreen-magazine-the-people-behind-bits-and-pixels.jpg" type="image/jpeg" length="33707" />

			
			<author><![CDATA[Osvaldas Valutis]]></author>

			
			<pubDate>Wed, 18 Apr 2012 15:53:00 +0300</pubDate>
		<feedburner:origLink>http://osvaldas.info/offscreen-magazine-the-people-behind-bits-and-pixels</feedburner:origLink></item>

		
		<item>
			<title><![CDATA[Letterpress Business Cards]]></title>
			<description>&lt;p&gt;Business cards, for me personally, for a long time were like a phenomenon from prehistoric times. Just like wired phones or cassette players. And there&amp;#39;s no need to look deeper why so, because bad design is always obvious. It just happened that all of the business cards I saw in my life were so &lt;a href="http://www.youtube.com/watch?v=4YBxeDN4tbk"&gt;crappy&lt;/a&gt;, that I have been always questioning myself why people share these ugly sheets of paper with one another.&lt;/p&gt;
&lt;h2&gt;Before&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://osvaldas.info/incoming/images/blog/letterpressed_business_cards_1.jpg" target="_blank"&gt;&lt;img alt="Old cards" class="right" src="http://osvaldas.info/incoming/images/blog/letterpressed_business_cards_1_small.jpg" /&gt;&lt;/a&gt;In the last few years as the Internet has reached its new heights in terms of information sharing, it also became very popular among graphic designers to share and sell their business card designs online. I believe that this direct competition has helped to improve the look of business cards all over the world, because if you want to be noticed, you must produce a good design. I would lie if I&amp;#39;d say I was blind and did not see what was happening. These gorgeous, funny (&lt;em&gt;I&amp;#39;m CEO, bitch!&lt;/em&gt;) and typographic cards have been spreading like a virus. As the matter of fact, I finally designed my very first business card. It was mine and had a feel of my&amp;nbsp;&lt;a href="http://v1.osvaldas.info" target="_blank"&gt;personal&lt;/a&gt; website at that time.&lt;/p&gt;
&lt;h2&gt;Now&lt;/h2&gt;
&lt;p&gt;Along with the &lt;a href="http://osvaldas.info/blog/welcome"&gt;redesign&lt;/a&gt;, I also redesigned my personal business card for an obvious reason. After dealing with big printing houses, their poor customer service, thin paper and cheap paint, I simply decided to search for quality services. Actually, I did not need to &lt;em&gt;search&lt;/em&gt;, because I had met &lt;a href="http://twitter.com/elegantepress" target="_blank"&gt;Saulius Dumbliauskas&lt;/a&gt;&amp;nbsp;via Twitter a couple of years ago and knew he has been running a small letterpress studio called&amp;nbsp;&lt;a href="http://elegantepress.com" target="_blank"&gt;Elegante Press&lt;/a&gt;&amp;nbsp;in Kaunas, Lithuania.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://osvaldas.info/incoming/images/blog/letterpressed_business_cards_4.jpg" target="_blank"&gt;&lt;img alt="Cards model" class="right" src="http://osvaldas.info/incoming/images/blog/letterpressed_business_cards_4_small.jpg" /&gt;&lt;/a&gt;Being charmed by their works, I designed my wish in Photoshop and sent them the image asking if they were able to bring this on my table. From the vary of options (sizes, types of paper, colors, edge painting, etc.) offered, I picked probably the most simple approach as this was my primary idea of &lt;em&gt;simplicity&lt;/em&gt;&amp;nbsp;and sent off the final PDF. I did choose one color, radiant white 430gsm paper.&lt;/p&gt;
&lt;p&gt;After two weeks I received the package. The first impression was very promising, really lovely and careful presented. I liked how one of the cards was put out of the inner package in the front, so that when you open the parcel with shaking hands of curiosity, you can finally calm down and start enjoying the result immediately.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Package" src="http://osvaldas.info/incoming/images/blog/letterpressed_business_cards_2.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Package" src="http://osvaldas.info/incoming/images/blog/letterpressed_business_cards_3.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;But most importantly, what about the cards? Clear letterpress effect. Precisely reproduced model from PDF that I sent. Thick paper, which you can touch and feel its surface. The cards are just fantastic. The people that I shared the cards with, were extremely delighted. They obviously felt special, therefore they won&amp;#39;t throw it away to the first trash bin available. It&amp;#39;s all about the small details.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Letterpressed Business Cards" src="http://osvaldas.info/incoming/images/blog/letterpressed_business_cards_6.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Letterpressed Business Cards" src="http://osvaldas.info/incoming/images/blog/letterpressed_business_cards_5.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;If you are designing your personal business cards, invitations, stationery &amp;ndash; make it special, leave an impression. And again, huge thanks to&amp;nbsp;&lt;a href="http://elegantepress.com" target="_blank"&gt;Elegante Press&lt;/a&gt;&amp;nbsp;for the remarkable result!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=ParAYOO2iJM:7Pxx1RrV7yQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=ParAYOO2iJM:7Pxx1RrV7yQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=ParAYOO2iJM:7Pxx1RrV7yQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=ParAYOO2iJM:7Pxx1RrV7yQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=ParAYOO2iJM:7Pxx1RrV7yQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=ParAYOO2iJM:7Pxx1RrV7yQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=ParAYOO2iJM:7Pxx1RrV7yQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/ParAYOO2iJM" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/ParAYOO2iJM/letterpressed-business-cards</link>
			<guid isPermaLink="false">http://osvaldas.info/letterpressed-business-cards</guid>
			<comments>http://osvaldas.info/letterpressed-business-cards#comments</comments>

			
			<category><![CDATA[Off Topic]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_letterpressed-business-cards.jpg" type="image/jpeg" length="29345" />

			
			<author><![CDATA[Osvaldas Valutis]]></author>

			
			<pubDate>Sun, 25 Mar 2012 11:12:00 +0300</pubDate>
		<feedburner:origLink>http://osvaldas.info/letterpressed-business-cards</feedburner:origLink></item>

		
		<item>
			<title><![CDATA[More Noticeable HTML Bookmarks]]></title>
			<description>&lt;p&gt;I have always been interested in elegant yet helpful techniques that in some way extend or rewrite native browser functionality and therefore help making websites a bit more better than they could be.&amp;nbsp;The last time I shared a technique for&amp;nbsp;&lt;a href="http://osvaldas.info/blog/elegant-css-and-jquery-tooltip-responsive-mobile-friendly"&gt;mobile-friendly and responsive tooltip&lt;/a&gt;, which indirectly extends functionality of &lt;code&gt;title&lt;/code&gt; attribute in HTML. This time: thoughts and a piece of code for, as titled, more noticeable HTML bookmarks &lt;em&gt;with&lt;/em&gt; &lt;a href="http://jquery.com"&gt;jQuery&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Actually, it&amp;#39;s nothing new, nothing that you could not do or think of on your own. Just sharing thoughts and code of what I have come up with while working on UX purposes.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://osvaldas.info/examples/more-noticeable-html-bookmarks" target="_blank"&gt;&lt;img alt="Bookmark" src="http://osvaldas.info/incoming/images/blog/more-noticeable-html-bookmarks.jpg" style="width: 100%; " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;The Problem&lt;/h2&gt;
&lt;p&gt;Let&amp;#39;s say you have an anchor that links to a particular location (which is actually location of the respective HTML element) on the same or other page of your website. Fine if the element is surrounded with a huge amount of the famous white space, fine if it is in the user-focus area and therefore easily noticeable. But, what if, in the worst case, it is a tiny little object squeezed among larger ones? Actually, I have a pure&amp;nbsp;&lt;strong&gt;example&lt;/strong&gt; here...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;T&lt;/b&gt;here is a small newsletter form in the footer of this website and I would like to encourage you subscribing to my newsletter if you haven&amp;#39;t yet. If I bookmarked it in the &lt;em&gt;old&lt;/em&gt; way I am pretty sure you would hardly notice the form in a second or two. In web design this is a huge amount of time which means a lot when it comes to engaging users to your product. Fortunately, I think I have an &lt;a href="#newsletter"&gt;intuitive&lt;/a&gt; (yeah, &lt;em&gt;click it&lt;/em&gt;) technique for you, so you can&amp;nbsp;&lt;em&gt;design&lt;/em&gt; a bit better product.&lt;/p&gt;
&lt;h2&gt;How It Works&lt;/h2&gt;
&lt;p&gt;When a page is loaded or an anchor is clicked, the script looks up for an element in HTML by &lt;code&gt;id&lt;/code&gt;&amp;nbsp;whose name has been provided via &lt;a href="http://www.w3.org/DesignIssues/Fragment.html" target="_blank"&gt;fragment identifier&lt;/a&gt;&amp;nbsp;on page-load or &lt;code&gt;href&lt;/code&gt; attribute value of an anchor when clicked. If the element exists, the browser then just smoothly scrolls to the location of the element and shakes it horizontally if it has an attribute/value&amp;nbsp;&lt;code&gt;data-bookmark=&amp;quot;nudge&amp;quot;&lt;/code&gt; defined.&lt;/p&gt;
&lt;p&gt;So, it&amp;#39;s not only the shake that helps to notice the target, but also, the animated scroll itself makes easier to understand where you are on the page, whether you are being thrown to the top or bottom. I think your users would thank you for that.&lt;/p&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;p&gt;Here&amp;#39;s a piece of JavaScript code, which is responsible for doing what mentioned above except the nudging.&lt;/p&gt;
&lt;pre class="brush:jscript;"&gt;$( document ).ready( function()
{
	function notice( selector )
	{
		var el = $( selector );

		if( el.length &amp;lt; 1 )
			return false;

		$( &amp;#39;html, body&amp;#39; ).animate( { scrollTop: el.offset().top }, 500, function()
		{
			if( el.attr( &amp;#39;data-bookmark&amp;#39; ) == &amp;#39;nudge&amp;#39; )
				el.nudge();

			if( window.location.hash != selector )
				window.location.hash = selector;
		});
	}

	$( &amp;#39;a[href*=&amp;quot;#&amp;quot;]&amp;#39; ).click( function( e )
	{
		var current_url = window.location.toString().replace( /#(.+)/i, &amp;#39;&amp;#39; ).replace(/\/+$/, &amp;#39;&amp;#39; ),
			new_url		= $( this ).attr( &amp;#39;href&amp;#39; ).replace( /#(.+)/i, &amp;#39;&amp;#39; ).replace(/\/+$/, &amp;#39;&amp;#39; );

		if( new_url == &amp;#39;&amp;#39; || new_url == current_url )
			e.preventDefault();

		notice( $( this ).attr( &amp;#39;href&amp;#39; ).replace( /(.+)#/i, &amp;#39;#&amp;#39; ) );
	});

	if( window.location.hash != &amp;#39;&amp;#39; )
		notice( window.location.hash );
});&lt;/pre&gt;
&lt;p&gt;Now that we have the the first part done, still there is one &lt;em&gt;unknown&lt;/em&gt; &amp;ndash; a function called &lt;code&gt;nudge&lt;/code&gt;. The way I applied it may automatically mean it is a native method of jQuery. Unfortunately not, but why not to extend the library so that we can use this function in a vary of situations later?&lt;/p&gt;
&lt;p&gt;No matter how your element is positioned, the function adapts and keeps it in a default state when shake is complete.&lt;/p&gt;
&lt;pre class="brush:jscript;"&gt;jQuery.fn.extend(
{
	nudge: function()
	{
		this.each( function()
		{
			if( $( this ).is( &amp;#39;:animated&amp;#39; ) )
				return false;

			var obj		 = $( this ),
				pos		 = obj.css( &amp;#39;position&amp;#39; ),
				left	 = obj.css( &amp;#39;left&amp;#39; ),
				left_int = parseInt( left ) || 0;

			if( left_int != 0 &amp;amp;&amp;amp; left.search( &amp;#39;%&amp;#39; ) &amp;gt; -1 )
				left_int = obj.parent().width() * left_int / 100;

			if( pos == &amp;#39;static&amp;#39; )
				obj.css( &amp;#39;position&amp;#39;, &amp;#39;relative&amp;#39; );

			setTimeout( function()
			{
				obj.stop( true, true )
				   .css( &amp;#39;left&amp;#39;, left_int + &amp;#39;px&amp;#39; )
				   .animate( { &amp;#39;left&amp;#39;: left_int - 5  + &amp;#39;px&amp;#39; }, 50 )
				   .animate( { &amp;#39;left&amp;#39;: left_int + 10 + &amp;#39;px&amp;#39; }, 100 )
				   .animate( { &amp;#39;left&amp;#39;: left_int - 10 + &amp;#39;px&amp;#39; }, 100 )
				   .animate( { &amp;#39;left&amp;#39;: left_int + 10 + &amp;#39;px&amp;#39; }, 100 )
				   .animate( { &amp;#39;left&amp;#39;: left_int - 10 + &amp;#39;px&amp;#39; }, 100 )
				   .animate( { &amp;#39;left&amp;#39;: left_int + 5  + &amp;#39;px&amp;#39; }, 50, function()
				   {
					   obj.css( { &amp;#39;position&amp;#39;: pos, &amp;#39;left&amp;#39;: left } );
				   });
			}, 500 );
		});
	}
});&lt;/pre&gt;
&lt;p&gt;Finally, let&amp;#39;s just write some typical HTML code, for example:&lt;/p&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;a href=&amp;quot;#newsletter&amp;quot;&amp;gt;Subscribe to newsletter!&amp;lt;/a&amp;gt;

&amp;lt;!-- here goes some &amp;quot;stranger&amp;quot; code --&amp;gt;

&amp;lt;form id=&amp;quot;newsletter&amp;quot; data-bookmark=&amp;quot;nudge&amp;quot;&amp;gt;
	&amp;lt;!-- ... --&amp;gt;
&amp;lt;/form&amp;gt;&lt;/pre&gt;
&lt;p&gt;I recommend using &lt;code&gt;data-bookmark=&amp;quot;nudge&amp;quot;&lt;/code&gt; wisely and nudge only what is really necessary. Do not shake huge elements. This may look and feel&amp;nbsp;inadequate and lame.&lt;/p&gt;
&lt;p&gt;&lt;a class="demo" href="http://osvaldas.info/examples/more-noticeable-html-bookmarks" target="_blank"&gt;Demo&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Info For Dummies&amp;nbsp;&lt;em&gt;or&lt;/em&gt;&amp;nbsp;How To Implement&lt;/h2&gt;
&lt;p&gt;Just put both JavaScript&amp;#39;s in existing JS file or create a new one and include in HTML. See the example above and modify your HTML if necessary. That&amp;#39;s it, couldn&amp;#39;t be more simple.&lt;/p&gt;
&lt;h2&gt;Post Scriptum&lt;/h2&gt;
&lt;p&gt;Because I defined nudging function as an extension/method of jQuery, next time I am going to fully justify my behavior by putting it in more use. What about shaking user login form when wrong username/password entered? Yes, that&amp;#39;s Apple-inspired.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-AeIJgaZyNs:WxMM5BU1biE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-AeIJgaZyNs:WxMM5BU1biE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=-AeIJgaZyNs:WxMM5BU1biE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-AeIJgaZyNs:WxMM5BU1biE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-AeIJgaZyNs:WxMM5BU1biE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=-AeIJgaZyNs:WxMM5BU1biE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-AeIJgaZyNs:WxMM5BU1biE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/-AeIJgaZyNs" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/-AeIJgaZyNs/more-noticeable-html-bookmarks</link>
			<guid isPermaLink="false">http://osvaldas.info/more-noticeable-html-bookmarks</guid>
			<comments>http://osvaldas.info/more-noticeable-html-bookmarks#comments</comments>

			
			<category><![CDATA[HTML]]></category>

			
			<category><![CDATA[jQuery]]></category>

			
			<category><![CDATA[JavaScript]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_more-noticeable-html-bookmarks.jpg" type="image/jpeg" length="36575" />

			
			<author><![CDATA[Osvaldas Valutis]]></author>

			
			<pubDate>Fri, 23 Mar 2012 16:12:00 +0200</pubDate>
		<feedburner:origLink>http://osvaldas.info/more-noticeable-html-bookmarks</feedburner:origLink></item>

		
		<item>
			<title><![CDATA[Database-driven Routing in CodeIgniter]]></title>
			<description>&lt;p&gt;&lt;a href="http://codeigniter.com" target="_blank"&gt;CodeIgniter&lt;/a&gt; is simple yet elegant, open source PHP framework developed by &lt;a href="http://ellislab.com" target="_blank"&gt;EllisLab&lt;/a&gt;. They also built the well-known &lt;a href="http://expressionengine.com/" target="_blank"&gt;ExpressionEngine&lt;/a&gt;&amp;nbsp;by using CodeIgniter as a &lt;em&gt;base&lt;/em&gt;. So that probably just proves, how powerful the framework is as well. Nevertheless, it is extremely easy learnable. Basically, their &lt;a href="http://codeigniter.com/user_guide/" target="_blank"&gt;User Guide&lt;/a&gt; is all you need to craft easy websites.&lt;/p&gt;
&lt;p&gt;&lt;img alt="CodeIgniter" src="http://osvaldas.info/incoming/images/blog/smart-database-driven-routing-in-codeigniter.jpg" style="width: 100%; " /&gt;&lt;/p&gt;
&lt;p&gt;I chose CodeIgniter over Wordpress because wanted to have my website customized as much as possible and be able to control it all over.&amp;nbsp;This post is probably an exception as I won&amp;#39;t be blogging much about server-side &lt;em&gt;things&lt;/em&gt;. But this time I just wanted to share a small, but very useful technique that I came up with (a year ago) after long hours of unsuccessful googling.&lt;/p&gt;
&lt;h2&gt;The Problem&lt;/h2&gt;
&lt;p&gt;Actually, it&amp;#39;s not a problem, not a bug of the framework. It just have this annoying &amp;#39;feature&amp;#39; that each time you want to add a page/controller, you must define it in &lt;code&gt;application/config/routes.php&lt;/code&gt; file by adding a line like this:&lt;/p&gt;
&lt;pre class="brush:php;"&gt;$route[ &amp;#39;journal&amp;#39; ] = &amp;#39;blog&amp;#39;;&lt;/pre&gt;
&lt;p&gt;It means that &lt;em&gt;Blog&lt;/em&gt; controller is executed when someone visits &lt;code&gt;/journal&lt;/code&gt; URL. Although array key accepts &lt;em&gt;Regular Expressions&lt;/em&gt;, that does not rescue the situation: you still have to &amp;nbsp;edit the file to enable your controllers. Awfully uncomfortable. It limits your abilities to make website dynamic and control pages somewhere in your super-duper backend. But what is the smart way enable the database-driven routing in CodeIgniter?&lt;/p&gt;
&lt;h2&gt;The Solution&lt;/h2&gt;
&lt;p&gt;The whole technique consists just of a small MySQL table&amp;nbsp;and a few lines of PHP code. &lt;strong&gt;How it works?&lt;/strong&gt;&amp;nbsp;The table holds our &lt;em&gt;URL&amp;nbsp;&amp;rarr; Controller&lt;/em&gt; records whereas the code fetches them and lists array entries (like mentioned above) dynamically. It also makes sure that further URL levels are directed to the base controller (or folder).&lt;/p&gt;
&lt;h2&gt;Database Table&lt;/h2&gt;
&lt;p&gt;Add the table &lt;code&gt;`app_routes`&lt;/code&gt; to your MySQL database:&lt;/p&gt;
&lt;pre class="brush:sql;"&gt;CREATE TABLE IF NOT EXISTS `app_routes` (
  `id` bigint(20) NOT NULL auto_increment,
  `slug` varchar(192) collate utf8_unicode_ci NOT NULL,
  `controller` varchar(64) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `slug` (`slug`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;&lt;/pre&gt;
&lt;h2&gt;PHP Code&lt;/h2&gt;
&lt;p&gt;Replace the code in&amp;nbsp;&lt;code&gt;application/config/routes.php&lt;/code&gt; with the one below:&lt;/p&gt;
&lt;pre class="brush:php;"&gt;$route[ &amp;#39;default_controller&amp;#39; ]	= &amp;#39;main&amp;#39;;
$route[ &amp;#39;404_override&amp;#39; ]		= &amp;#39;error404&amp;#39;;

require_once( BASEPATH .&amp;#39;database/DB&amp;#39;. EXT );
$db =&amp;amp; DB();
$query = $db-&amp;gt;get( &amp;#39;app_routes&amp;#39; );
$result = $query-&amp;gt;result();
foreach( $result as $row )
{
	$route[ $row-&amp;gt;slug ]					= $row-&amp;gt;controller;
	$route[ $row-&amp;gt;slug.&amp;#39;/:any&amp;#39; ]			= $row-&amp;gt;controller;
	$route[ $row-&amp;gt;controller ]			= &amp;#39;error404&amp;#39;;
	$route[ $row-&amp;gt;controller.&amp;#39;/:any&amp;#39; ]	= &amp;#39;error404&amp;#39;;
}&lt;/pre&gt;
&lt;p&gt;Feel free to change the values of &lt;code&gt;default_controller&lt;/code&gt; and &lt;code&gt;404_override&lt;/code&gt; to what you need or already have. That&amp;#39;s it! Now you have a database-driven routing in CodeIgniter enabled!&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;p&gt;Let&amp;#39;s say you have a controller (class) named &lt;em&gt;Portfolio&lt;/em&gt;, but prefer to make it reachable not by very long &lt;code&gt;/portfolio&lt;/code&gt; URL, but by shorter &lt;code&gt;/work&lt;/code&gt;. Simply add a database entry and you&amp;#39;re done:&lt;/p&gt;
&lt;pre class="brush:sql;"&gt;INSERT INTO `app_routes` (`slug`, `controller`) VALUES (&amp;#39;work&amp;#39;, &amp;#39;portfolio&amp;#39;);&lt;/pre&gt;
&lt;h2&gt;Last Bits&lt;/h2&gt;
&lt;p&gt;Managing routes via MySQL queries is pretty the same as editing the &lt;code&gt;routes.php&lt;/code&gt; file. To make this type of routing meaningful, you should develop a tool for your backend that allows to manage &lt;code&gt;`app_routes`&lt;/code&gt; table. Have a look at mine for an idea:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://osvaldas.info/incoming/images/blog/codeigniter_routing_panel.jpg" style="width: 100%; " /&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=0x0iU-YVANE:MNkUnM6vWgM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=0x0iU-YVANE:MNkUnM6vWgM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=0x0iU-YVANE:MNkUnM6vWgM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=0x0iU-YVANE:MNkUnM6vWgM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=0x0iU-YVANE:MNkUnM6vWgM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=0x0iU-YVANE:MNkUnM6vWgM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=0x0iU-YVANE:MNkUnM6vWgM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/0x0iU-YVANE" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/0x0iU-YVANE/smart-database-driven-routing-in-codeigniter</link>
			<guid isPermaLink="false">http://osvaldas.info/smart-database-driven-routing-in-codeigniter</guid>
			<comments>http://osvaldas.info/smart-database-driven-routing-in-codeigniter#comments</comments>

			
			<category><![CDATA[SQL]]></category>

			
			<category><![CDATA[PHP]]></category>

			
			<category><![CDATA[CodeIgniter]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_smart-database-driven-routing-in-codeigniter.jpg" type="image/jpeg" length="31008" />

			
			<author><![CDATA[Osvaldas Valutis]]></author>

			
			<pubDate>Sat, 18 Feb 2012 14:10:00 +0200</pubDate>
		<feedburner:origLink>http://osvaldas.info/smart-database-driven-routing-in-codeigniter</feedburner:origLink></item>

		
		<item>
			<title><![CDATA[Responsive and Mobile-Friendly Tooltip]]></title>
			<description>&lt;p&gt;Tooltip is a splendid invention. Small detail in web design that plays a big role when it comes to user experience. Usually, tooltips are used to present a tiny amount of hidden content (mainly explanatory, so-called tips), that pops up when user moves a cursor over or clicks (less common) on a special target.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://osvaldas.info/examples/elegant-css-and-jquery-tooltip-responsive-mobile-friendly/" target="_blank"&gt;&lt;img alt="Elegant CSS and jQuery Tooltip: Responsive, Mobile-Friendly" src="http://osvaldas.info/incoming/images/blog/css_jquery_tooltip.jpg" style="width: 100%; " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When working on my personal website, I was in need of a tooltip. I decided not to limit it just on a typical definition of a tooltip, but also make it a better occurrence using CSS and jQuery technologies.&lt;/p&gt;
&lt;h2&gt;Key Features&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;It&amp;#39;s &lt;strong&gt;responsive&lt;/strong&gt;. It relies on a maximum width value when viewed on large screens, adopts to narrow environments and picks the best viewable position relatively to the target (top, bottom; left, center, right);&lt;/li&gt;
	&lt;li&gt;It&amp;#39;s &lt;strong&gt;mobile-friendly&lt;/strong&gt;. It pops up when a call-to-action button is tapped and disappears when tapped on the tooltip itself;&lt;/li&gt;
	&lt;li&gt;It&amp;#39;s &lt;strong&gt;HTML formatting capable&lt;/strong&gt;. Need to write some words in italic or so? No problem, this will work out.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;CSS&lt;/h2&gt;
&lt;p&gt;To begin with, let&amp;#39;s build the look of our tooltip. No fancy styling, just major properties so you can clearly see how it works (all of the sexy things will take part in the demo below).&lt;/p&gt;
&lt;pre class="brush:css;"&gt;#tooltip
{
	text-align: center;
	color: #fff;
	background: #111;
	position: absolute;
	z-index: 100;
	padding: 15px;
}

	#tooltip:after /* triangle decoration */
	{
		width: 0;
		height: 0;
		border-left: 10px solid transparent;
		border-right: 10px solid transparent;
		border-top: 10px solid #111;
		content: &amp;#39;&amp;#39;;
		position: absolute;
		left: 50%;
		bottom: -10px;
		margin-left: -10px;
	}

		#tooltip.top:after
		{
			border-top-color: transparent;
			border-bottom: 10px solid #111;
			top: -20px;
			bottom: auto;
		}

		#tooltip.left:after
		{
			left: 10px;
			margin: 0;
		}

		#tooltip.right:after
		{
			right: 10px;
			left: auto;
			margin: 0;
		}&lt;/pre&gt;
&lt;h2&gt;JavaScript&lt;/h2&gt;
&lt;pre class="brush:jscript;"&gt;$( document ).ready( function()
{
	var targets = $( &amp;#39;[rel~=tooltip]&amp;#39; ),
		target	= false,
		tooltip = false,
		title	= false;

	targets.bind( &amp;#39;mouseenter&amp;#39;, function()
	{
		target	= $( this );
		tip		= target.attr( &amp;#39;title&amp;#39; );
		tooltip	= $( &amp;#39;&amp;lt;div id=&amp;quot;tooltip&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;#39; );

		if( !tip || tip == &amp;#39;&amp;#39; )
			return false;

		target.removeAttr( &amp;#39;title&amp;#39; );
		tooltip.css( &amp;#39;opacity&amp;#39;, 0 )
			   .html( tip )
			   .appendTo( &amp;#39;body&amp;#39; );

		var init_tooltip = function()
		{
			if( $( window ).width() &amp;lt; tooltip.outerWidth() * 1.5 )
				tooltip.css( &amp;#39;max-width&amp;#39;, $( window ).width() / 2 );
			else
				tooltip.css( &amp;#39;max-width&amp;#39;, 340 );

			var pos_left = target.offset().left + ( target.outerWidth() / 2 ) - ( tooltip.outerWidth() / 2 ),
				pos_top	 = target.offset().top - tooltip.outerHeight() - 20;

			if( pos_left &amp;lt; 0 )
			{
				pos_left = target.offset().left + target.outerWidth() / 2 - 20;
				tooltip.addClass( &amp;#39;left&amp;#39; );
			}
			else
				tooltip.removeClass( &amp;#39;left&amp;#39; );

			if( pos_left + tooltip.outerWidth() &amp;gt; $( window ).width() )
			{
				pos_left = target.offset().left - tooltip.outerWidth() + target.outerWidth() / 2 + 20;
				tooltip.addClass( &amp;#39;right&amp;#39; );
			}
			else
				tooltip.removeClass( &amp;#39;right&amp;#39; );

			if( pos_top &amp;lt; 0 )
			{
				var pos_top	 = target.offset().top + target.outerHeight();
				tooltip.addClass( &amp;#39;top&amp;#39; );
			}
			else
				tooltip.removeClass( &amp;#39;top&amp;#39; );

			tooltip.css( { left: pos_left, top: pos_top } )
				   .animate( { top: &amp;#39;+=10&amp;#39;, opacity: 1 }, 50 );
		};

		init_tooltip();
		$( window ).resize( init_tooltip );

		var remove_tooltip = function()
		{
			tooltip.animate( { top: &amp;#39;-=10&amp;#39;, opacity: 0 }, 50, function()
			{
				$( this ).remove();
			});

			target.attr( &amp;#39;title&amp;#39;, tip );
		};

		target.bind( &amp;#39;mouseleave&amp;#39;, remove_tooltip );
		tooltip.bind( &amp;#39;click&amp;#39;, remove_tooltip );
	});
});
&lt;/pre&gt;
&lt;h2&gt;HTML Example&lt;/h2&gt;
&lt;pre class="brush:xml;"&gt;&amp;lt;abbr title=&amp;quot;User Experience&amp;quot; rel=&amp;quot;tooltip&amp;quot;&amp;gt;UX&amp;lt;/abbr&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;a class="demo" href="http://osvaldas.info/examples/elegant-css-and-jquery-tooltip-responsive-mobile-friendly/" target="_blank"&gt;View demo&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;How To Implement&lt;/h2&gt;
&lt;ol&gt;
	&lt;li&gt;Put the CSS code anywhere in existing CSS file or create a new one. You can also insert it in HTML file in &lt;em&gt;head&lt;/em&gt;&amp;nbsp;by wrapping the code with &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/style&amp;gt;&lt;/code&gt; tags.&lt;/li&gt;
	&lt;li&gt;Put the JavaScript code in existing JS file or create a new one. You can also insert it in HTML file in &lt;em&gt;head&lt;/em&gt;&amp;nbsp;or, better, &lt;em&gt;body&lt;/em&gt; by wrapping the code with &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/script&amp;gt;&lt;/code&gt; tags.&lt;/li&gt;
	&lt;li&gt;Assign the attribute &lt;code&gt;rel=&amp;quot;tooltip&amp;quot;&lt;/code&gt;&amp;nbsp;and &lt;code&gt;title=&amp;quot;Enter your tip here&amp;quot;&lt;/code&gt; to any of &lt;em&gt;body&lt;/em&gt; tags in HTML file where you want the tooltip to pop up when called. Set &lt;em&gt;title&lt;/em&gt; value with your tip (use &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt;&amp;nbsp;etc. to distinguish text fragments, but avoid &lt;em&gt;block&lt;/em&gt; elements).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Also, be sure that you already have &lt;a href="http://jquery.com" target="_blank"&gt;jQuery&lt;/a&gt; library included.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s it! Simple enough. If you&amp;#39;ve got any suggestions or insights, feel free to share them: leave a comment or send me a &lt;a href="http://twitter.com/osvaldas" target="_blank"&gt;tweet&lt;/a&gt;.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-4HOe4_xMxE:RNTG1k-MS-o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-4HOe4_xMxE:RNTG1k-MS-o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=-4HOe4_xMxE:RNTG1k-MS-o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-4HOe4_xMxE:RNTG1k-MS-o:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-4HOe4_xMxE:RNTG1k-MS-o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?i=-4HOe4_xMxE:RNTG1k-MS-o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?a=-4HOe4_xMxE:RNTG1k-MS-o:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OsvaldasValutisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OsvaldasValutisBlog/~4/-4HOe4_xMxE" height="1" width="1"/&gt;</description>
			<link>http://feedproxy.google.com/~r/OsvaldasValutisBlog/~3/-4HOe4_xMxE/elegant-css-and-jquery-tooltip-responsive-mobile-friendly</link>
			<guid isPermaLink="false">http://osvaldas.info/elegant-css-and-jquery-tooltip-responsive-mobile-friendly</guid>
			<comments>http://osvaldas.info/elegant-css-and-jquery-tooltip-responsive-mobile-friendly#comments</comments>

			
			<category><![CDATA[Mobile]]></category>

			
			<category><![CDATA[Touch]]></category>

			
			<category><![CDATA[Tooltip]]></category>

			
			<category><![CDATA[HTML]]></category>

			
			<category><![CDATA[Responsive]]></category>

			
			<category><![CDATA[jQuery]]></category>

			
			<category><![CDATA[JavaScript]]></category>

			
			<category><![CDATA[CSS]]></category>

			
			<enclosure url="http://osvaldas.info/incoming/images/posts/blog/thumb_elegant-css-and-jquery-tooltip-responsive-mobile-friendly.jpg" type="image/jpeg" length="30939" />

			
			<author><![CDATA[Osvaldas Valutis]]></author>

			
			<pubDate>Thu, 16 Feb 2012 10:48:00 +0200</pubDate>
		<feedburner:origLink>http://osvaldas.info/elegant-css-and-jquery-tooltip-responsive-mobile-friendly</feedburner:origLink></item>

		
	</channel>

</rss>
