<?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>Graphical user interface &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/graphical-user-interface/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>clickoutside jQuery plugin</title>
		<link>/2010/02/17/clickoutside-jquery-plugin/</link>
		<comments>/2010/02/17/clickoutside-jquery-plugin/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 15:00:14 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Feedback]]></category>
		<category><![CDATA[Graphical user interface]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Modal window]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[Windows games]]></category>

		<guid isPermaLink="false">/?p=1116</guid>
		<description><![CDATA[I wrote a small plugin to jQuery that adds the event of clicking outside an element. You know sometimes you should close some modal windows when clicking outside. It&#8217;s really simple and small. Please provide any feedback that will improve it. (function(jQuery) { jQuery.fn.clickoutside = function(callback) { var outside = 1, self = $(this); self.cb &#8230; <a href="/2010/02/17/clickoutside-jquery-plugin/" class="more-link">Continue reading <span class="screen-reader-text">clickoutside jQuery plugin</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/10/22/event-driven-programming-with-jquery-part-3-what-is-a-module/" rel="bookmark" title="Event driven programming with jQuery &#8211; (part 3). What is a module?">Event driven programming with jQuery &#8211; (part 3). What is a module? </a></li>
<li><a href="/2010/02/16/jquery-tooltip-plugin/" rel="bookmark" title="jQuery tooltip plugin!">jQuery tooltip plugin! </a></li>
<li><a href="/2009/07/29/cancel-bubbling-on-element-click-with-jquery/" rel="bookmark" title="cancel bubbling on element click with jQuery">cancel bubbling on element click with jQuery </a></li>
<li><a href="/2010/02/25/jquery-localstorage-plugin/" rel="bookmark" title="jQuery localStorage plugin">jQuery localStorage plugin </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I wrote a small plugin to jQuery that adds the event of clicking outside an element. You know sometimes you should close some modal windows when clicking outside. It&#8217;s really simple and small. Please provide any feedback that will improve it.</p>
<pre lang="javascript" line="1" escaped="true">(function(jQuery) {
   jQuery.fn.clickoutside = function(callback) {
      var outside = 1, self = $(this);
      self.cb = callback;
      this.click(function() {
         outside = 0;
      });
      $(document).click(function() {
         outside &amp;&amp; self.cb();
         outside = 1;
      });
      return $(this);
   }
})(jQuery);
</pre>
<p>You can see the demo page <a title="jquery tooltip clickoutside" href="http://www.stoimen.com/jquery.clickoutside.plugin/" target="_blank">here</a>. To install it just include the chunk above after the jQuery library code.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/10/22/event-driven-programming-with-jquery-part-3-what-is-a-module/" rel="bookmark" title="Event driven programming with jQuery &#8211; (part 3). What is a module?">Event driven programming with jQuery &#8211; (part 3). What is a module? </a></li>
<li><a href="/2010/02/16/jquery-tooltip-plugin/" rel="bookmark" title="jQuery tooltip plugin!">jQuery tooltip plugin! </a></li>
<li><a href="/2009/07/29/cancel-bubbling-on-element-click-with-jquery/" rel="bookmark" title="cancel bubbling on element click with jQuery">cancel bubbling on element click with jQuery </a></li>
<li><a href="/2010/02/25/jquery-localstorage-plugin/" rel="bookmark" title="jQuery localStorage plugin">jQuery localStorage plugin </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/02/17/clickoutside-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>jQuery tooltip plugin!</title>
		<link>/2010/02/16/jquery-tooltip-plugin/</link>
		<comments>/2010/02/16/jquery-tooltip-plugin/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 11:43:57 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Alt attribute]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Graphical user interface]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[HTML element]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Markup languages]]></category>
		<category><![CDATA[Rel attribute]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[Tooltip]]></category>
		<category><![CDATA[User interface]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">/?p=1099</guid>
		<description><![CDATA[Tooltips and jQuery In order to complete the tooltip post series I decided to make a plugin for jQuery that implements tooltips in the most simple way I was able to find! I have no idea what are the other plugins for tooltips and I never used such plugin, but however I needed one in &#8230; <a href="/2010/02/16/jquery-tooltip-plugin/" class="more-link">Continue reading <span class="screen-reader-text">jQuery tooltip plugin!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/02/17/clickoutside-jquery-plugin/" rel="bookmark" title="clickoutside jQuery plugin">clickoutside jQuery plugin </a></li>
<li><a href="/2010/06/22/jquery-get-the-selected-option-text/" rel="bookmark" title="jQuery: Get the Selected Option Text">jQuery: Get the Selected Option Text </a></li>
<li><a href="/2009/07/16/jquery-browser-and-os-detection-plugin/" rel="bookmark" title="jQuery browser and OS detection plugin">jQuery browser and OS detection plugin </a></li>
<li><a href="/2010/09/24/2xjquery-select-a-selector/" rel="bookmark" title="2xjQuery: Select a Selector">2xjQuery: Select a Selector </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Tooltips and jQuery</h2>
<p>In order to complete the tooltip post series I decided to make a plugin for <a title="jquery" href="http://jquery.com/" target="_blank">jQuery</a> that implements tooltips in the most simple way I was able to find! I have no idea what are the other plugins for tooltips and I never used such plugin, but however I needed one in order to complete my task an suddenly I turn it into a plugin.</p>
<p>What I&#8217;d like to hear is requests for improvements and bugs reported, just to make the plugin as useful as possible.</p>
<p>Let&#8217;s start in that post with some primary HTML markup, here are the <a title="jquery tooltip plugin source" href="http://www.stoimen.com/jquery.tooltip.plugin/jquery.tooltip.js" target="_blank">complete source</a> and <a title="jquery tooltip plugin" href="http://www.stoimen.com/jquery.tooltip.plugin/" target="_blank">demo page</a>.</p>
<blockquote>
<pre>&lt;html&gt;
&lt;head&gt;
 &lt;title&gt;jQuery tooltip&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;A DIV element wrapped in another DIV that's 800 pixels wide and thus defines the bounds&lt;/p&gt;
&lt;div id="wrap" style="width:800px;border:1px solid blue;"&gt;
 &lt;div id="container" title='test' rel="here's some&lt;br /&gt;HTML and image&lt;br /&gt;&lt;img src='/jquery-logo.png' /&gt;" style="border:1px solid red;"&gt;
 &lt;p&gt;
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer rhoncus vulputate arcu in mollis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla nunc libero, eleifend in imperdiet lacinia, pellentesque eget turpis. Nulla consectetur augue vulputate arcu porta tempus. Mauris nisl risus, fermentum posuere sodales sed, accumsan in massa. Pellentesque facilisis, felis sit amet vulputate egestas, nibh lacus sollicitudin nulla, non commodo nunc elit et eros. Nulla eu placerat mauris. Phasellus sit amet odio nec dui pharetra pulvinar. Nunc sollicitudin, nisl quis interdum consequat, diam dolor condimentum felis, ac porttitor turpis augue nec sapien. Quisque pulvinar nulla ut elit dapibus in tempus ipsum interdum. Pellentesque feugiat tempus tortor, mollis fringilla ligula faucibus nec. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent cursus ullamcorper lacus. Maecenas at blandit justo. Maecenas adipiscing velit luctus mauris gravida adipiscing. Morbi molestie ipsum metus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sapien mi, hendrerit sit amet semper ut, condimentum et risus. Nulla facilisi.
 &lt;/p&gt;
 &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When defined over an image the tooltip gets the text into the alt attribute by default&lt;/p&gt;
&lt;img id="my-img" src="/jquery-logo.png" alt="test" /&gt;
&lt;p&gt;When you attach the .tooltip() method on a link it gets its title attribute for the tooltip by default. Note that you can add more and more links after you attach the .tooltip() method on that class name. This is because the plugin make use of the .live() method of jQuery&lt;/p&gt;
&lt;a href="http://stoimen.com/" title="a title of the link"&gt;Just a link!&lt;/a&gt;</pre>
</blockquote>
<p>And right after that the JavaScript:</p>
<blockquote>
<pre>&lt;!-- include the jQuery library --&gt;
&lt;script src="/jquery-1.3.2.js"&gt;&lt;/script&gt;
&lt;script&gt;
// this is the plugin code. You can copy/paste it at the bottom of the jquery.js library file
(function(jQuery) {
 jQuery.fn.tooltip = function(options) {
 $('body').append('&lt;div id="sstt" style="display:none;"&gt;&lt;/div&gt;');
 if (typeof options == 'undefined') options = {};
 this.live('mousemove', function(e) {

 var att = 'attribute' in options &amp;&amp; $(this).attr(options.attribute);
 if(!att) att = $(this).attr('rel');

 var bbox = 'bbox' in options &amp;&amp; options.bbox;
 if (!bbox) bbox = $(document);

 if ('text' in options &amp;&amp; options.text) att = options.text;

 if ($(this).is('img')) att = $(this).attr('alt');
 if ($(this).is('a')) att = $(this).attr('title');

 var elem = $('#sstt'),csstxt = elem.css('cssText'),ew=elem.width(),dw=bbox.width(),px=e.pageX+10,py=e.pageY+10;
 elem.html(att);
 var eloffset = dw &gt; px+ew &amp;&amp;
 elem.css('cssText', csstxt+';position:absolute;top:'+py+'px;left:'+px+'px;display:block');

 !eloffset &amp;&amp;
 elem.css('cssText', csstxt+';position:absolute;top:'+py+'px;left:'+(dw-ew)+'px;display:block');
 });
 this.live('mouseout', function() {
 $('#sstt').hide();
 });
 };
})(jQuery);</pre>
</blockquote>
<h2>How to setup the options?</h2>
<p>The .tooltip() method has an optional &#8220;options&#8221; parameter that specifies simple parameters for the tooltip itself.</p>
<blockquote>
<pre>{
 attribute : 'rel',
 bbox : $(document),
 text : ''
}</pre>
</blockquote>
<p>By default the plugin uses the REL attribute for the text of the tooltip, but you can override it by setting the options attribute property:</p>
<blockquote>
<pre>var options = { attribute:'title'}</pre>
</blockquote>
<p>Here the tooltip will take the TITLE attribute value. Note that the TITLE attribute is default for anchor tags and the construction above will be default for them. Over links the .tooltip() method gets the ALT attribute.</p>
<p><strong>bbox</strong> is the default bound box for the tooltip. Default value is $(document), but it can be any other jQuery object. Look at the examples bellow.</p>
<p><strong>text</strong> is predefining the tooltip&#8217;s text.</p>
<h2>Finally some examples</h2>
<p>1. Usage with no options. The REL attribute is considered as text for the tooltip and the bound box is the document:</p>
<blockquote>
<pre>$('#container').tooltip();</pre>
</blockquote>
<p>2. Usage with bound box. The REL is yet again considered as text for the tootip and the bound box is passed as argument as a jQuery object.<br />
2.1. The parent element:</p>
<blockquote>
<pre>$('#container').tooltip({bbox:$('#container').parent()});</pre>
</blockquote>
<p>2.2. Explicit defined parent element:</p>
<blockquote>
<pre>$('#container').tooltip({bbox:$('#wrap')});</pre>
</blockquote>
<p>3. Predefine the text of the tooltip:</p>
<blockquote>
<pre>$('#container').tooltip({text:'Hello World!'});</pre>
</blockquote>
<p>3.1.  It can be even HTML formatted text:</p>
<blockquote>
<pre>$('#container').tooltip({text:'Hello &lt;br /&gt; World!'});</pre>
</blockquote>
<p>4. Predefine the attribute. Now the default REL is dismissed and the TITLE is considered for the tooltip:</p>
<blockquote>
<pre>$('#container').tooltip({attribute:'title'});</pre>
</blockquote>
<p>5. Default for image is not REL but the ALT attribute:</p>
<blockquote>
<pre>$('#my-img').tooltip();</pre>
</blockquote>
<p>6. Default for link is not REL, but the TITLE attribute:</p>
<blockquote>
<pre>$('.my-link').tooltip();</pre>
</blockquote>
<p>7. You can even add some links from the same class on the fly, but they are still working, because of the live event binding:</p>
<blockquote>
<pre>$('body').append('&lt;a href="http://stoimen.com/" title="another link"&gt;some other link&lt;/a&gt;');</pre>
</blockquote>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/02/17/clickoutside-jquery-plugin/" rel="bookmark" title="clickoutside jQuery plugin">clickoutside jQuery plugin </a></li>
<li><a href="/2010/06/22/jquery-get-the-selected-option-text/" rel="bookmark" title="jQuery: Get the Selected Option Text">jQuery: Get the Selected Option Text </a></li>
<li><a href="/2009/07/16/jquery-browser-and-os-detection-plugin/" rel="bookmark" title="jQuery browser and OS detection plugin">jQuery browser and OS detection plugin </a></li>
<li><a href="/2010/09/24/2xjquery-select-a-selector/" rel="bookmark" title="2xjQuery: Select a Selector">2xjQuery: Select a Selector </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/02/16/jquery-tooltip-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fancy tooltips with jQuery</title>
		<link>/2010/02/06/fancy-tooltips-with-jquery/</link>
		<comments>/2010/02/06/fancy-tooltips-with-jquery/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 07:25:19 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[Fancy]]></category>
		<category><![CDATA[Graphical user interface]]></category>
		<category><![CDATA[Human Interest]]></category>
		<category><![CDATA[Sampling]]></category>
		<category><![CDATA[Tooltip]]></category>
		<category><![CDATA[User interface techniques]]></category>
		<category><![CDATA[web developer]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">/?p=638</guid>
		<description><![CDATA[I was decided to write this post from long time ago and now I&#8217;m pretty sure it has to be published. What I see in my practice and my browsing in the web there are too many old fashioned tooltips all over the web, as web developer don&#8217;t know how to make pretty good fancy &#8230; <a href="/2010/02/06/fancy-tooltips-with-jquery/" class="more-link">Continue reading <span class="screen-reader-text">Fancy tooltips with jQuery</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/02/16/jquery-tooltip-plugin/" rel="bookmark" title="jQuery tooltip plugin!">jQuery tooltip plugin! </a></li>
<li><a href="/2010/02/17/clickoutside-jquery-plugin/" rel="bookmark" title="clickoutside jQuery plugin">clickoutside jQuery plugin </a></li>
<li><a href="/2009/10/21/event-driven-programming-with-jquery-part-2-events-in-jquery/" rel="bookmark" title="Event driven programming with jQuery &#8211; (part 2). Events in jQuery.">Event driven programming with jQuery &#8211; (part 2). Events in jQuery. </a></li>
<li><a href="/2010/02/02/firebugs-console-time-accuracy/" rel="bookmark" title="Firebug&#8217;s console.time() accuracy">Firebug&#8217;s console.time() accuracy </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I was decided to write this post from long time ago and now I&#8217;m pretty sure it has to be published. What I see in my practice and my browsing in the web there are too many old fashioned tooltips all over the web, as web developer don&#8217;t know how to make pretty good fancy tooltips.</p>
<p>That&#8217;s why I decided to show what&#8217;s not and what is fancy tooltip, with the help of jQuery. Of course don&#8217;t hesitate to make with every other library or pure JS code.</p>
<h2>What is NOT fancy?</h2>
<p>It&#8217;s not fancy when the tooltip is with fixed position. In the example <a href="http://www.stoimen.com/jquery.fancy.tooltip.plugin/not-fancy.html" target="_blank">here</a> I made one pretty small sample:</p>
<p><a href="/wp-content/uploads/2010/02/not-fancy.png"><img class="aligncenter size-full wp-image-1066" title="not-fancy" src="/wp-content/uploads/2010/02/not-fancy.png" alt="" width="288" height="183" /></a></p>
<h2>What is fancy?</h2>
<p>In the other side you can make the tooltip moving with the mouse pointer which is way better, as you can see <a href="http://www.stoimen.com/jquery.fancy.tooltip.plugin/fancy.html" target="_blank">here</a>:</p>
<p><a href="/wp-content/uploads/2010/02/fancy.png"><img class="aligncenter size-full wp-image-1065" title="fancy" src="/wp-content/uploads/2010/02/fancy.png" alt="" width="300" height="165" /></a></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/02/16/jquery-tooltip-plugin/" rel="bookmark" title="jQuery tooltip plugin!">jQuery tooltip plugin! </a></li>
<li><a href="/2010/02/17/clickoutside-jquery-plugin/" rel="bookmark" title="clickoutside jQuery plugin">clickoutside jQuery plugin </a></li>
<li><a href="/2009/10/21/event-driven-programming-with-jquery-part-2-events-in-jquery/" rel="bookmark" title="Event driven programming with jQuery &#8211; (part 2). Events in jQuery.">Event driven programming with jQuery &#8211; (part 2). Events in jQuery. </a></li>
<li><a href="/2010/02/02/firebugs-console-time-accuracy/" rel="bookmark" title="Firebug&#8217;s console.time() accuracy">Firebug&#8217;s console.time() accuracy </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/02/06/fancy-tooltips-with-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
