<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vadikom &#187; Dailies</title>
	<atom:link href="http://vadikom.com/categories/dailies/feed/" rel="self" type="application/rss+xml" />
	<link>http://vadikom.com</link>
	<description>web design, web development tools and tutorials from Plovdiv, Bulgaria</description>
	<lastBuildDate>Wed, 20 Jul 2011 13:56:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to Disable and Hide the Facebook Chat</title>
		<link>http://vadikom.com/dailies/how-to-disable-and-hide-the-facebook-chat/</link>
		<comments>http://vadikom.com/dailies/how-to-disable-and-hide-the-facebook-chat/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 12:46:04 +0000</pubDate>
		<dc:creator>Vasil Dinkov</dc:creator>
				<category><![CDATA[Dailies]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[facebook chat]]></category>
		<category><![CDATA[GreaseKit]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[user.js]]></category>

		<guid isPermaLink="false">http://vadikom.com/?p=1291</guid>
		<description><![CDATA[After hard and long resistance, I finally gave up and recently signed up for Facebook. I am still not excited about it and quite deeply believe it can mainly bring negatives to people who post all kind of personal stuff. But anyway, since I am using it already from time to time, the single most [...]]]></description>
			<content:encoded><![CDATA[<p>After hard and long resistance, I finally gave up and recently signed up for Facebook. I am still not excited about it and quite deeply believe it can mainly bring negatives to people who post all kind of personal stuff. But anyway, since I am using it already from time to time, the single most annoying thing that caught my attention immediately (in the otherwise clean and arguably intuitive interface) was the fixed positioned chat box at the bottom of all pages. There was simply no way to remove it even if I didn't want to use the chat at all. And guess what, it seems the past few days that small collapsed box at the bottom has been transformed into a complete sidebar pushing the rest of the page to the left which is even more annoying (this seems to happen if the browser window is wide enough). Me doesn't like this at all so I am now sharing my solution to this annoyance with you...</p>

<span id="more-1291"></span>

<p>Just install this small user script in your browser (Opera, Chrome, Firefox via <a href="http://www.greasespot.net/">Greasemonkey</a> or Safari via <a href="http://8-p.info/greasekit/">GreaseKit</a>):</p>

<p><a href="https://raw.github.com/vadikom/facebook-nochat/master/facebook-nochat.user.js">https://raw.github.com/vadikom/facebook-nochat/master/facebook-nochat.user.js</a></p>

<p>and remove that chat floating box/sidebar for good! As a bonus, it will make sure you always appear unavailable for chat. Second bonus - when the sidebar is removed, the rest of the page will be perfectly centered in your browser window again. Yay!</p>]]></content:encoded>
			<wfw:commentRss>http://vadikom.com/dailies/how-to-disable-and-hide-the-facebook-chat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>offsetWidth/offsetHeight useless in IE9, FF4*</title>
		<link>http://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/</link>
		<comments>http://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/#comments</comments>
		<pubDate>Thu, 12 May 2011 11:03:52 +0000</pubDate>
		<dc:creator>Vasil Dinkov</dc:creator>
				<category><![CDATA[Dailies]]></category>
		<category><![CDATA[FF4]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE9]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[subpixel]]></category>

		<guid isPermaLink="false">http://vadikom.com/?p=1077</guid>
		<description><![CDATA[OK, I must admit "useless" is a too harsh word but the thing is our beloved offsetWidth/offsetHeight JavaScript DOM properties are now not accurate any more in Internet Explorer 9 and Firefox 4. Firstly introduced in IE4 in 1997, these DOM properties are the simplest and quickest way of getting the computed pixel dimensions (the [...]]]></description>
			<content:encoded><![CDATA[<p>OK, I must admit "useless" is a too harsh word but the thing is our beloved <code>offsetWidth</code>/<code>offsetHeight</code> JavaScript DOM properties are now not accurate any more in Internet Explorer 9 and Firefox 4. Firstly introduced in IE4 in 1997, these DOM properties are the simplest and quickest way of getting the computed pixel dimensions (the border-box) of any page element and they used to work perfectly in all browsers released since then. Well, not any more in IE9 and FF4. Read on to learn why and what you can do to workaround the issue...</p>

<p style="font-style:italic;">* <span style="font-family:georgia, 'times new roman', times, serif;font-size:16px;">A special note for Firefox on Windows/Linux</span><br />Firefox 4 on Windows and Linux has this issue only when hardware accelerated rendering is enabled in the Options/Preferences (and, of course, supported on the machine). I always get the issue on Mac.</em></p>

<span id="more-1077"></span>

<p>IE9 and FF4 introduced subpixel font rendering and now calculate and report width/height of page elements using float values even when a web page is viewed at 100% zoom level. This is something no other browser has ever done before. So, right now in IE9 and FF4 you can get computed width/height values for block elements reported like "100.34px", "11.65px", etc. I once heard from a colleague that a client asked him to move a page element by <em>half a pixel</em> because apparently one pixel seemed to much to him. <img src='http://vadikom.com/wp-content/plugins/tango-smilies/tango/face-smile-big.png' alt=':D' class='wp-smiley' />  Well, I've got good news for that guy, this is now possible!</p>

<p>But seriously, let's get back to the issue. As you already may be guessing, the problem with <code>offsetWidth</code>/<code>offsetHeight</code> in IE9 &amp; FF4 is that these properties are integer values so in these browsers the values are computed by rounding the float values for width/height and adding the padding &amp; border. And the rounding often leads to 1px inaccuracy depending on the calculations done in your scripts and on the exact fonts and font sizes used on the page. You may say 1px is nothing but there are cases when 1px could cause quite notable issues like, for example, text wrapping happening when it shouldn't, etc..</p>

<h2><span>Demoing the Problem</span></h2>
<p>Basically now you can easily stumble upon issues in IE9 and FF4 like on this <a href="http://vadikom.com/demos/offsetwidth-offsetheight-issue-in-ie9-firefox4/demo.html">demo page</a>. In this example, <code>offsetHeight</code> is used to get the computed border-box height of the first DIV and the second DIV has negative top margin applied which is equal to the value returned. The end result should be perfectly overlapping DIVs, so that you could only see the second one. But in IE9 or FF4, you can see either the top or the bottom border of the first DIV sneaking beneath the second DIV for some of the iterations:</p>

<p class="figure"><img src="http://vadikom.com/wp-content/uploads/2011/05/offsetwidth-offsetheight-issue-ie9-firefox4_1.png" alt="A screenshot showing the top border of the first DIV sneaking beneath the second DIV" title="" width="339" height="183" class="alignnone size-full" /></p>

<h2><span>The Workaround</span></h2>
<p>From the demo above we clearly see we can no longer use <code>offsetWidth</code>/<code>offsetHeight</code> if we want perfect results in these browsers. The workaround is to use the <code>getComputedStyle()</code> method instead which reports the width/height of block elements with float numbers. So basically, the workaround is to get the computed width/height and then add the computed top/bottom padding &amp; border of the element to get the final value. The problem with <code>getComputedStyle()</code> on theory is that for width/height of inline elements it always reports <code>'auto'</code>. But the good news is these browsers only seem to round the computed float values for block elements and so for inline elements we can still safely use <code>offsetWidth</code>/<code>offsetHeight</code>! Well, if you are still following me, here is a fully cross-browser workaround compatible with all other and older browsers:</p>

<div class="code-block">
<pre class="sh_javascript">function _getOffset(elm, height) {
	var cStyle = elm.ownerDocument &#038;& elm.ownerDocument.defaultView &#038;& elm.ownerDocument.defaultView.getComputedStyle
		&#038;& elm.ownerDocument.defaultView.getComputedStyle(elm, null),
		ret = cStyle &#038;& cStyle.getPropertyValue(height ? 'height' : 'width') || '';
	if (ret &#038;& ret.indexOf('.') > -1) {
		ret = parseFloat(ret)
			+ parseInt(cStyle.getPropertyValue(height ? 'padding-top' : 'padding-left'))
			+ parseInt(cStyle.getPropertyValue(height ? 'padding-bottom' : 'padding-right'))
			+ parseInt(cStyle.getPropertyValue(height ? 'border-top-width' : 'border-left-width'))
			+ parseInt(cStyle.getPropertyValue(height ? 'border-bottom-width' : 'border-right-width'));
	} else {
		ret = height ? elm.offsetHeight : elm.offsetWidth;
	}
	return ret;
}
function getOffsetWidth(elm) {
	return _getOffset(elm);
}
function getOffsetHeight(elm) {
	return _getOffset(elm, true);
}</pre>
</div>

<p>Usage is very simple:</p>

<div class="code-block">
<pre class="sh_javascript">var elmOffsetWidth = getOffsetWidth(elm);
var elmOffsetHeight = getOffsetHeight(elm);</pre>
</div>

<p>And here is the <a href="http://vadikom.com/demos/offsetwidth-offsetheight-issue-in-ie9-firefox4/demo-fix.html">fixed demo page</a> that includes the workaround.</p>

<h2><span>The Questions</span></h2>
<p>Finally, here are the questions that come to my mind:</p>
<ol>
<li>Is this the road all other major browsers (i.e. WebKit and Opera) plan to take in the future?</li>
<li>If not, why did IE and FF did it then and shouldn't they revert to the old behavior?</li>
<li>If yes, then shouldn't at least <code>offsetWidth</code>/<code>offsetHeight</code> be fixed to return the preciser float values?</li>
</ol>
<p>I guess you'd agree it's nice to have these questions answered.</p>]]></content:encoded>
			<wfw:commentRss>http://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fix for #NewTwitter: Scrolling the Details Pane</title>
		<link>http://vadikom.com/dailies/fix-for-new-twitter-scrolling-of-the-details-pane/</link>
		<comments>http://vadikom.com/dailies/fix-for-new-twitter-scrolling-of-the-details-pane/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 18:32:03 +0000</pubDate>
		<dc:creator>Vasil Dinkov</dc:creator>
				<category><![CDATA[Dailies]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[DOMMouseScroll]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[GreaseKit]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[onmousewheel]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[user.js]]></category>

		<guid isPermaLink="false">http://vadikom.com/?p=976</guid>
		<description><![CDATA[I am getting more and more used to #NewTwitter and generally like the new features. Particularly the details pane, which provides quick preview of images, videos, etc. is really very useful. However, there is something related to it that annoys me much - if you scroll it with the mouse wheel (which is definitely the [...]]]></description>
			<content:encoded><![CDATA[<p>I am getting more and more used to <a href="http://twitter.com/search?q=%23NewTwitter">#NewTwitter</a> and generally like the new features. Particularly the details pane, which provides quick preview of images, videos, etc. is really very useful. However, there is something related to it that annoys me much - if you scroll it with the mouse wheel (which is definitely the case with the majority of users) once you reach the top or bottom and continue scrolling (e.g. by accident, which happens to me very often), the whole page begins scrolling and you can easily lose sight of the tweet on the left to which the pane is related. So I am now sharing a simple fix and if you like it, please help to let the guys at Twitter know about it.</p>

<span id="more-976"></span>

<p>First, a very quick demo of what I mean:</p>

<p class="video"><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='547' height='361'><param name='movie' value='http://screenr.com/Content/assets/screenr_1116090935.swf' /><param name='flashvars' value='i=124583' /><param name='allowFullScreen' value='true' /><embed src='http://screenr.com/Content/assets/screenr_1116090935.swf' flashvars='i=124583' allowFullScreen='true' width='547' height='361' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object></p>

<p>And the JavaScript/jQuery snippet which fixes the issue:</p>

<div class="code-block">
<pre class="sh_javascript">$('#page-container div.pane-components').live('mousewheel DOMMouseScroll', function(e) {
	var scrollTop = this.scrollTop,
		clientHeight = this.clientHeight,
		scrollHeight = this.scrollHeight,
		originalEvent = e.originalEvent,
		scrollingUp = (originalEvent.wheelDelta || -originalEvent.detail) > 0;
	if (scrollingUp &#038;& scrollTop == 0 || !scrollingUp &#038;& scrollTop + clientHeight == scrollHeight)
		e.preventDefault();
})</pre>
</div>

<p>It just checks if the top or bottom of the details pane has been reached and when it has, the default action the mouse wheel event triggers (i.e. scrolling the whole page) is prevented.</p>

<p>If you would like to test the fix on your own, just load some Twitter page in your browser, then copy/paste the following code in your browser address bar and hit the "Enter" key:</p>

<div class="code-block">
<pre class="sh_javascript">javascript:$('#page-container div.pane-components').live('mousewheel DOMMouseScroll', function(e) {
	var scrollTop = this.scrollTop,
		clientHeight = this.clientHeight,
		scrollHeight = this.scrollHeight,
		originalEvent = e.originalEvent,
		scrollingUp = (originalEvent.wheelDelta || -originalEvent.detail) > 0;
	if (scrollingUp &#038;& scrollTop == 0 || !scrollingUp &#038;& scrollTop + clientHeight == scrollHeight)
		e.preventDefault();
});void(0)</pre>
</div>

<p>And for a permanent fix, until eventually Twitter fixes the issue, you can install the following user script in your browser (Opera, Chrome, Firefox via <a href="http://www.greasespot.net/">Greasemonkey</a> or Safari via <a href="http://8-p.info/greasekit/">GreaseKit</a>):</p>

<p><a href="https://github.com/vadikom/twitter-scroll-fix/raw/master/twitter-scroll-fix.user.js">https://github.com/vadikom/twitter-scroll-fix/raw/master/twitter-scroll-fix.user.js</a></p>

<h2><span>Spread the Word</span></h2>
<p>If you find this fix useful, <a href="http://twitter.com/share?text=Fix+for+%23NewTwitter%3A+Improving+the+Scrolling+Behavior+of+the+Details+Pane+(please+RT!)&#038;url=http%3A%2F%2Fvadikom.com%2Fdailies%2Ffix-for-new-twitter-scrolling-of-the-details-pane%2F&#038;via=vadikom">tweet about it</a> so that it can reach the guys at Twitter and they consider using it or a similar solution.</p>
<p>Well, that's all I can do about it. <img src='http://vadikom.com/wp-content/plugins/tango-smilies/tango/idea.png' alt=':idea:' class='wp-smiley' /> </p>]]></content:encoded>
			<wfw:commentRss>http://vadikom.com/dailies/fix-for-new-twitter-scrolling-of-the-details-pane/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Up &amp; Running</title>
		<link>http://vadikom.com/dailies/up-and-running/</link>
		<comments>http://vadikom.com/dailies/up-and-running/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 08:45:10 +0000</pubDate>
		<dc:creator>Vasil Dinkov</dc:creator>
				<category><![CDATA[Dailies]]></category>
		<category><![CDATA[About]]></category>
		<category><![CDATA[Vadikom]]></category>

		<guid isPermaLink="false">http://192.168.0.1:9001/?p=641</guid>
		<description><![CDATA[I am happy to finally reveal the curtain of this website. So what is it all about? Well, this is essentially a blog where I will post about whatever bugs my days as a web developer slash designer. I am mainly a front-end developer so this place is most likely to get filled over time [...]]]></description>
			<content:encoded><![CDATA[<p>I am happy to finally reveal the curtain of this website. <strong>So what is it all about?</strong> Well, this is essentially a blog where I will post about whatever bugs my days as a web developer <i>slash</i> designer. I am mainly a front-end developer so this place is most likely to get filled over time with stuff related to the <em>"visible"</em> part of web development - free tools (e.g. jQuery plugins), short tutorials (CSS, JavaScript, etc.), design ideas and inspiration, news and topics that bother the regular web developer mates. Occasionally, you may also find a personal topic or two but I don't have any plans to make a personal diary out of all this, instead I will mostly cover here the professional part of my life.</p>
<span id="more-641"></span>
<h2><span>But who am I after all?</span></h2>
<p>Ah, sorry for being impolite and not introducing myself right away! <img src='http://vadikom.com/wp-content/plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' />  My name is Vasil Dinkov and I live and work in Plovdiv, Bulgaria. I am the guy behind the <a href="http://www.smartmenus.org/">SmartMenus Website Menu</a> and the <a href="http://www.freshfavicon.com/">FreshFavicon Favicon Gallery</a>. If you would like to learn a bit more, you can check out the <a href="/about/">about page</a>.</p>
<p>Well, I think that's it for now. I hope you find something useful here in the future and do not regret for just waisting your time when visiting Vadikom.com!</p>]]></content:encoded>
			<wfw:commentRss>http://vadikom.com/dailies/up-and-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

