<?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</title>
	<atom:link href="https://vadikom.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://vadikom.com</link>
	<description>web design, web development tools and tutorials from Plovdiv, Bulgaria</description>
	<lastBuildDate>Thu, 30 Jul 2020 07:28:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>So long, Apple.</title>
		<link>https://vadikom.com/dailies/so-long-apple/</link>
		
		<dc:creator><![CDATA[Vasil Dinkov]]></dc:creator>
		<pubDate>Thu, 30 Jul 2020 07:28:26 +0000</pubDate>
				<category><![CDATA[Dailies]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[HP ProBook]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacBook Pro]]></category>
		<category><![CDATA[macOS]]></category>
		<category><![CDATA[My 2 cents]]></category>
		<category><![CDATA[Pop!_OS]]></category>
		<guid isPermaLink="false">https://vadikom.com/?p=1470</guid>

					<description><![CDATA[My beloved MacBook Pro 13" mid 2010 is nearing its end of life as Apple is preparing to halt any support for macOS 10.13 High Sierra and as much as I hate to, I will have to replace it by the end of 2020. It might seem odd it's still my main machine but having [&#8230;]]]></description>
										<content:encoded><![CDATA[<figure class="figure"><img fetchpriority="high" decoding="async" src="https://vadikom.com/wp-content/uploads/2020/07/macbook-pro-shut-down.png" alt="Cursor over a macOS Shut Down... menu option" title="" width="980" height="551" class="alignnone size-full wp-image-1483" srcset="https://vadikom.com/wp-content/uploads/2020/07/macbook-pro-shut-down.png 980w, https://vadikom.com/wp-content/uploads/2020/07/macbook-pro-shut-down-300x169.png 300w, https://vadikom.com/wp-content/uploads/2020/07/macbook-pro-shut-down-768x432.png 768w" sizes="(max-width: 980px) 100vw, 980px" /></figure>
<p class="post-intro">My beloved MacBook Pro 13" mid 2010 is nearing its end of life as Apple is preparing to halt any support for macOS 10.13 High Sierra and as much as I hate to, I will have to replace it by the end of 2020. It might seem odd it's still my main machine but having upgraded it with a fast SSD and 10 GB of RAM a few years ago, I still find it capable of handling my everyday web development needs.</p>
<p>So what is my dream replacement machine? Honestly, if Apple offered today the same laptop with up-to-date internals, it would be an instant purchase for me. Just give me the same enclosure, ports (I wouldn't mind if you swap the FireWire for USB-C), keyboard and I would be more than happy. I don't even care about the screen, I use an external monitor most of the time.</p>
<p>The keyboard alone deserves a separate paragraph. I have never used an external keyboard and you can imagine how much beating mine has seen in 10 years. And add to that a couple of times my little son forcefully disassemble many of the keys (the Space bar is hardest to reassemble BTW <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ) and still to this day not a single key has failed!</p>
<p>But no, Apple seems to have a different opinion. And I honestly have no clue why they chose to break and cripple something that was not broken. Not broken at all. Soldered RAM, even soldered SSD (is this a joke?), a single port type, no MagSafe (this thing has saved my laptop from dents at least a dozen times), stupid experiments with a rock-solid keyboard (hopefully, they got it right finally). I mean if this is some kind of smart phone-like consumer device, I could understand but you still dare to call this a professional laptop? Sorry, I'll pass.</p>
<p>I've already ordered a HP ProBook 430 G7 which offers practically the same upgradability like my MacBook Pro mid 2010 - 2 RAM slots, SSD slot + 2.5" HDD slot I will gladly use for a backup drive (I like keeping my private data "private" instead of storing it somewhere in the cloud). I don't need a beefy GPU so the integrated one will do just fine. It has a touchscreen and that's always handy for testing. Honestly, I just hope the keyboard is reliable enough, everything else is ideal for me.</p>
<p>Of course, the main thing I will miss initially is macOS but switching to a new platform was not a big issue last time. Ten years ago I went from Windows to Mac. I am certainly never getting back to Windows considering what a complete mess it is today. Honestly, in 10 years I feel like it's only gotten worse, I can't even stand looking at Windows 10's interface mess. UI consistency is arguably not great on any platform but to me it feels like in Windows 10 it's a whole new level of inconsistency.</p>
<p>So it's Linux for me this time and <a href="https://pop.system76.com">Pop!_OS</a> is my initial choice. I've never used Linux for work but I've played with many different distros through the years and configuring a work station will not be a problem. What does a web dev need today anyway - a terminal, a text editor, a browser, some collaboration app?... It's all there.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SmartMenus jQuery Plugin Now Available</title>
		<link>https://vadikom.com/news/smartmenus-jquery-plugin-released/</link>
		
		<dc:creator><![CDATA[Vasil Dinkov]]></dc:creator>
		<pubDate>Mon, 03 Jun 2013 11:24:07 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<guid isPermaLink="false">http://vadikom.com/?p=1388</guid>

					<description><![CDATA[After about a couple of years in planning &#38; development SmartMenus jQuery is finally available! Website menus that work on all devices.]]></description>
										<content:encoded><![CDATA[<p>After about a couple of years in planning &amp; development SmartMenus jQuery is finally available! Website menus that work on all devices.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Disable and Hide the Facebook Chat</title>
		<link>https://vadikom.com/dailies/how-to-disable-and-hide-the-facebook-chat/</link>
					<comments>https://vadikom.com/dailies/how-to-disable-and-hide-the-facebook-chat/#comments</comments>
		
		<dc:creator><![CDATA[Vasil Dinkov]]></dc:creator>
		<pubDate>Fri, 15 Jul 2011 12:46:04 +0000</pubDate>
				<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 [&#8230;]]]></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>https://vadikom.com/dailies/how-to-disable-and-hide-the-facebook-chat/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>Poshy Tip Updated to v1.1</title>
		<link>https://vadikom.com/news/poshy-tip-updated-to-v1-1/</link>
					<comments>https://vadikom.com/news/poshy-tip-updated-to-v1-1/#comments</comments>
		
		<dc:creator><![CDATA[Vasil Dinkov]]></dc:creator>
		<pubDate>Tue, 17 May 2011 14:00:45 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<guid isPermaLink="false">http://vadikom.com/?p=1281</guid>

					<description><![CDATA[Full compatibility with jQuery 1.6, live events support, background image preloading, small fixes for IE9 &#38; FF4 are amongst the new features...]]></description>
										<content:encoded><![CDATA[<p>Full compatibility with jQuery 1.6, live events support, background image preloading, small fixes for IE9 &amp; FF4 are amongst the new features...</p>]]></content:encoded>
					
					<wfw:commentRss>https://vadikom.com/news/poshy-tip-updated-to-v1-1/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>offsetWidth/offsetHeight useless in IE9, FF4*</title>
		<link>https://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/</link>
					<comments>https://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/#comments</comments>
		
		<dc:creator><![CDATA[Vasil Dinkov]]></dc:creator>
		<pubDate>Thu, 12 May 2011 11:03:52 +0000</pubDate>
				<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 [&#8230;]]]></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;">* A special note for Firefox on Windows/Linux<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="https://s.w.org/images/core/emoji/17.0.2/72x72/1f603.png" alt="😃" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 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="/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 decoding="async" src="/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 && elm.ownerDocument.defaultView && elm.ownerDocument.defaultView.getComputedStyle
		&& elm.ownerDocument.defaultView.getComputedStyle(elm, null),
		ret = cStyle && cStyle.getPropertyValue(height ? 'height' : 'width') || '';
	if (ret && 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="/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>https://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>Fix for #NewTwitter: Scrolling the Details Pane</title>
		<link>https://vadikom.com/dailies/fix-for-new-twitter-scrolling-of-the-details-pane/</link>
					<comments>https://vadikom.com/dailies/fix-for-new-twitter-scrolling-of-the-details-pane/#comments</comments>
		
		<dc:creator><![CDATA[Vasil Dinkov]]></dc:creator>
		<pubDate>Tue, 09 Nov 2010 18:32:03 +0000</pubDate>
				<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 [&#8230;]]]></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><strong>Update:</strong> Twitter have changed their design so this post covers a previous issue on their website and is no longer relevant.</p>

<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 && scrollTop == 0 || !scrollingUp && 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 && scrollTop == 0 || !scrollingUp && 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!)&url=http%3A%2F%2Fvadikom.com%2Fdailies%2Ffix-for-new-twitter-scrolling-of-the-details-pane%2F&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.</p>]]></content:encoded>
					
					<wfw:commentRss>https://vadikom.com/dailies/fix-for-new-twitter-scrolling-of-the-details-pane/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Zoom Image - (Greasemonkey) User Script</title>
		<link>https://vadikom.com/tools/zoom-image-greasemonkey-user-script/</link>
					<comments>https://vadikom.com/tools/zoom-image-greasemonkey-user-script/#comments</comments>
		
		<dc:creator><![CDATA[Vasil Dinkov]]></dc:creator>
		<pubDate>Sun, 17 Oct 2010 17:23:00 +0000</pubDate>
				<category><![CDATA[Tools]]></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=783</guid>

					<description><![CDATA[Zoom Image is small user script I originally wrote back in 2005 for Greasemonkey and Opera but nowadays Chrome (out of the box) and Safari (through GreaseKit) users could use it too. The basic idea is pretty simple - the script displays a small toolbar with some buttons in the top left corner of any [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Zoom Image is small user script I originally wrote back in 2005 for <a href="http://www.greasespot.net/">Greasemonkey</a> and Opera but nowadays Chrome (out of the box) and Safari (through <a href="http://8-p.info/greasekit/">GreaseKit</a>) users could use it too. The basic idea is pretty simple - the script displays a small toolbar with some buttons in the top left corner of any image when you hover it allowing easily to zoom in/out just the image without the need to zoom the whole page.</p>

<span id="more-783"></span>

<p>It may seem a pretty insignificant addition to your browser's features at first sight but, at least for me, it has proven to be a really handy one and I have not stopped using it in my main browser (Opera) since I first wrote it. BTW, the original version of the script was featured in Mark Pilgrim's <a href="http://www.oreilly.com/catalog/greasemonkeyhks/">Greasemonkey Hacks</a> book which means at least one other user found it useful. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>

<p>Anyway, I am now publishing v2.0 which brings some nice improvements over the previous release.</p>

<h2><span>What's new in v2.0</span></h2>
<ul>
 <li>you can now even easier zoom in/out the image by using the mouse wheel too - just hover the toolbar (any button) and use the mouse wheel (if you have one, that is :P)</li>
 <li>rewritten <abbr title="Object Oriented">OO</abbr> code allowing easily to add more custom buttons</li>
 <li>improved look (arguably) of the menu/buttons including light and dark style</li>
 <li>added optional show fade-in animation - disabled by default as it might become obtrusive over time (at least for me it does)</li>
</ul>

<h2><span>User Configuration</span></h2>
<p>The script includes the following options which you could tweak to your liking:</p>
<div class="code-block">
<pre class="sh_javascript">zoomFactorClick = 1.5,		// zoom in/out by this factor each time
zoomFactorMouseWheel = 1.2,	// just hover the toolbar (any button) and use the wheel
showTimeout = 1.2,		// seconds
minimalImageWidth = 60,		// minimal width of the images the toolbar is activated for
minimalImageHeight = 50,	// minimal height of the images the toolbar is activated for
opacity = 0.80,			// opacity for the toolbar
fade = false,			// use fade animation when showing the toolbar
darkStyle = false,		// use dark style for the toolbar
zIndexFix = true;		// try to keep the zoomed image on top of other elements on the page</pre>
</div>

<h2><span>Adding More Custom Buttons</span></h2>
<p>As mentioned, the script is now rewritten and allows more easily adding custom buttons to the toolbar. You can create a custom button like this:</p>
<div class="code-block">
<pre class="sh_javascript">var myButton = new Button(name, className, title, contentHTML, handlers);</pre>
</div>
<p>And then append it to the toolbar like this:</p>
<div class="code-block">
<pre class="sh_javascript">zoomToolbar.addButton(myButton);</pre>
</div>
<h3>Example: Adding an "open" button</h3>
<p>Here is a quick example how to add an "open" button which when clicked, loads the image in a new blank browser window:</p>
<div class="code-block">
<pre class="sh_javascript">var openButton = new Button('openButton', 'text-button', 'Open Image in New Window', 'open', {
	click: function() {
		window.open(image.src);
		zoomToolbar.hide();
	}
});
zoomToolbar.addButton(openButton);</pre>
</div>
<p>I have added this button at the end of the Zoom Image code as well as another button "size" which when clicked reports the original dimensions of the image in a JavaScript alert popup. These buttons are disabled by default (the code is commented out) but you could enable them if you like.</p>

<h2><span>Download / Install</span></h2>
<p>Here is a direct link to the latest version available in the code repository:</p>
<p><a href="http://github.com/vadikom/zoom-image/raw/master/zoom-image.user.js">http://github.com/vadikom/zoom-image/raw/master/zoom-image.user.js</a></p>
<p>The code is hosted on GitHub:</p>
<div class="code-block">
<pre class="sh_html">git clone git://github.com/vadikom/zoom-image.git</pre>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://vadikom.com/tools/zoom-image-greasemonkey-user-script/feed/</wfw:commentRss>
			<slash:comments>17</slash:comments>
		
		
			</item>
		<item>
		<title>Poshy Tip - jQuery Plugin for Stylish Tooltips</title>
		<link>https://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/</link>
					<comments>https://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/#comments</comments>
		
		<dc:creator><![CDATA[Vasil Dinkov]]></dc:creator>
		<pubDate>Mon, 26 Jul 2010 09:49:18 +0000</pubDate>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Plugins]]></category>
		<category><![CDATA[Poshy Tip]]></category>
		<guid isPermaLink="false">http://192.168.0.1:9001/?p=407</guid>

					<description><![CDATA[I almost hear you asking - why another jQuery tooltip plugin? Well, I actually never planned creating this plugin until I reached the final stages of designing this website and decided to add some pretty tooltips. So I started looking for a tooltip plugin that allows easily creating stylish tooltips and also includes the most [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I almost hear you asking - why another jQuery tooltip plugin? Well, I actually never planned creating this plugin until I reached the final stages of designing this website and decided to add some pretty tooltips. So I started looking for a tooltip plugin that allows easily creating stylish tooltips and also includes the most useful features for such a script. However, I wasn't pleased with the results I found so I ended up writing a completely new plugin and am now making it available for all.</p>

<span id="more-407"></span>

<h2><span>Demos</span></h2>
<p>You might be eager to take a look at some examples so here is the <a href="/demos/poshytip/">demo page</a> right away. And below you will find a short introduction.</p>

<h2><span>Notable Features</span></h2>

<p>OK, so apart from the awful name, is there anything interesting about this tooltip plugin?</p>

<h3>A Single Background Image for Scalable Tooltips</h3>

<p>Suppose you need to code a <em>scalable</em> tooltip that looks like this (i.e. a tooltip with auto width/height based on the content inside it):</p>
<p class="figure"><img decoding="async" src="/wp-content/uploads/2010/07/poshytip_1.png" alt="A figure showing a tooltip mockup that should be used to create a scalable tooltip on the page" title="" width="495" height="113" class="alignnone size-full wp-image-518" /></p>

<h4>The Usual Approach</h4>

<p>To achieve this with most similar plugins out there you would need to slice the image into multiple separate images - for the corners of the box, for the sides, etc.:</p>
<p class="figure"><img loading="lazy" decoding="async" src="/wp-content/uploads/2010/07/poshytip_2.png" alt="A figure showing how you would normally need to slice the mockup into 9 images in order to code a scalable tooltip" title="" width="495" height="195" class="alignnone size-full wp-image-519" /></p>

<h4>The Poshy Tip Approach</h4>

<p>But since the tooltips only work when JavaScript is enabled anyway, why not apply some JS magic which would make our life easier and save our server some additional requests? This is exactly what Poshy Tip was designed to do. With this plugin, you can create a scalable tooltip by just using a single background image for the tooltip body:</p>
<p class="figure"><img loading="lazy" decoding="async" src="/wp-content/uploads/2010/07/poshytip_3.png" alt="With Poshy Tip you need just 2 images - one for the tooltip body + 1 for the arrow" title="" width="495" height="255" class="alignnone size-full wp-image-520" /></p>
<p>You need to create one big image for the tooltip body - e.g. something like 1024x768 pixels (which should be enough for anything you may want to display inside a tooltip in the browser viewport). You then have to set it as a background image for the tooltip container DIV in the most trivial way:</p>

<div class="code-block">
<pre class="sh_css">.tip-yellow {
	...
	background-image: url(tip-yellow.png);
}</pre>
</div>

<p>Poshy Tip detects when a background image has been set for the tooltip container DIV and creates a scalable frame from it that wraps the inner contents of the tip. Finally, you just need to specify what should be the size of the background image frame around the inner content by setting the following option:</p>

<div class="code-block">
<pre class="sh_javascript">bgImageFrameSize: 10 // pixels</pre>
</div>

<p>And the result:</p>
<p class="figure"><img loading="lazy" decoding="async" src="/wp-content/uploads/2010/07/poshytip_4.png" alt="A figure showing the scalable frame created from the background image that wraps the inner DIV" title="" width="495" height="183" class="alignnone size-full wp-image-521" /></p>
<p>You can, of course, tweak the margin/padding of the inner DIV if needed.</p>

<h3>Advanced Positioning Options</h3>

<p>With Poshy Tip you can position the tips relative to the mouse cursor or to the target element and align them in every possible way horizontally and vertically (note the <code>alignTo</code>, <code>alignX</code> and <code>alignY</code> options). In addition the script makes sure the tips are always displayed in the browser viewport and also automatically positions the arrow (if available) on the appropriate side of the tooltip body.</p>

<h3>Asynchronous Loading of the Tooltip Content</h3>

<p>Poshy Tip supports using a function for returning the tooltip content and the script also passes an update callback function as an argument to this function. By using this callback, you can easily update asynchronously the content of the tooltip after it has been displayed. You can see a quick example on the demo page.</p>

<h2><span>Documentation</span></h2>

<p>You can find usage examples and a list of the options and methods available on the <a href="/demos/poshytip/">demo page</a>.</p>

<h2><span>License</span></h2>

<p>Like jQuery, Poshy Tip is dual licensed under the <a href="http://github.com/vadikom/poshytip/raw/master/MIT-LICENSE.txt">MIT</a> and <a href="http://github.com/vadikom/poshytip/raw/master/GPL-LICENSE.txt">GPL</a> licenses.</p>

<h2><span>Git</span></h2>

<p>The Poshy Tip source code is also available at GitHub:</p>
<div class="code-block">
<pre class="sh_html">git clone git://github.com/vadikom/poshytip.git</pre>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/feed/</wfw:commentRss>
			<slash:comments>282</slash:comments>
		
		
			</item>
		<item>
		<title>Up &#038; Running</title>
		<link>https://vadikom.com/dailies/up-and-running/</link>
		
		<dc:creator><![CDATA[Vasil Dinkov]]></dc:creator>
		<pubDate>Mon, 26 Jul 2010 08:45:10 +0000</pubDate>
				<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 [&#8230;]]]></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="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 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>
					
		
		
			</item>
	</channel>
</rss>
