<?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>Blog de Livi &#187; Javascript</title>
	<atom:link href="http://blog.delivi.com/topics/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.delivi.com</link>
	<description></description>
	<lastBuildDate>Tue, 29 Jun 2010 15:52:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1-alpha-15359</generator>
		<item>
		<title>Updated: Hover for non-anchor elements in IE6</title>
		<link>http://blog.delivi.com/javascript/updated-hover-for-non-anchor-elements-in-ie6</link>
		<comments>http://blog.delivi.com/javascript/updated-hover-for-non-anchor-elements-in-ie6#comments</comments>
		<pubDate>Wed, 28 Apr 2010 20:03:33 +0000</pubDate>
		<dc:creator>livingston</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.delivi.com/?p=52</guid>
		<description><![CDATA[The updated version of the previous version of Hover for non-anchor elements in IE 6. Before proceeding further, here&#8217;s a brief description of the problem, The &#8216;:hover&#8217; pseudo-class works on all visual elements in IE 7+, FF, Safari, Chrome and &#8230; <a href="http://blog.delivi.com/javascript/updated-hover-for-non-anchor-elements-in-ie6">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The updated version of the previous version of <a href='http://blog.delivi.com/javascript/hover-for-non-anchor-elements-in-ie6/' rel='nofollow'>Hover for non-anchor elements in IE 6</a>.</p>
<p>Before proceeding further, here&#8217;s a brief description of the problem,</p>
<p><cite>The &#8216;:hover&#8217; pseudo-class works on all visual elements in <abbr title="Internet Explorer">IE</abbr> 7+, <abbr title="Firefox">FF</abbr>, Safari, Chrome and Opera. But for obvious reasons <abbr title="Internet Explorer">IE</abbr> 6 fails to recognize the &#8216;:hover&#8217; pseudo-class for elements other than the anchor(&lt;a&gt;&lt;/a&gt;).</cite></p>
<p>Here is the updated code, which is faster and is targeted only IE 6 by a combination of JavaScript conditional comments &#038; feature detection.</p>
<pre class="brush:javascript">
    (function ($) {
        $(document).ready(function () {
            $.single=function(a){return function(b){a[0]=b;return a}}($([1]));
            /*@cc_on
                if (!window.XMLHttpRequest) {
                    $('.hoverable').each(function () {
                        this.attachEvent('onmouseenter', function (evt) { $.single(evt.srcElement).addClass('hovered'); });
                        this.attachEvent('onmouseleave', function (evt) { $.single(evt.srcElement).removeClass('hovered'); });
                    });
                }
            @*/
        });
    }(jQuery));
</pre>
<p>All you&#8217;ve to do is to include this script in your html document and add the class &#8216;hoverable&#8217; to all the non-anchor elements to which you want the hover action. And in your stylesheet add an extra selector for the element along with the &#8216;:hover&#8217; style definition. Look at the code of the <a href='http://blog.delivi.com/examples/ie6-hover/updated.html' title=''>updated example</a> to get a clear idea.</p>
<p>I&#8217;ve used <a href='http://james.padolsey.com/javascript/76-bytes-for-faster-jquery/' rel='external'>James Padolsey&#8217;s single jQuery object snippet</a> in the event handlers to prevent the creation of a new jQuery object every time the event handler is executed, hence saving a few execution cycles and memory.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.delivi.com/javascript/updated-hover-for-non-anchor-elements-in-ie6/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hover for non-anchor elements in IE6</title>
		<link>http://blog.delivi.com/javascript/hover-for-non-anchor-elements-in-ie6</link>
		<comments>http://blog.delivi.com/javascript/hover-for-non-anchor-elements-in-ie6#comments</comments>
		<pubDate>Wed, 20 Feb 2008 11:15:00 +0000</pubDate>
		<dc:creator>livingston</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[IE6 Hover]]></category>

		<guid isPermaLink="false">http://blog.delivi.info/javascript/hover-for-non-anchor-elements-in-ie6/</guid>
		<description><![CDATA[Updated article on Hover for non-anchor elements in IE6 The :hover pseudo-class adds a special style to an element when you mouse over it. The &#8216;:hover&#8217; pseudo-class works fine in IE7, FF, Safari and Opera for all the elements. But &#8230; <a href="http://blog.delivi.com/javascript/hover-for-non-anchor-elements-in-ie6">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Updated article on <a href="http://blog.delivi.com/javascript/updated-hover-for-non-anchor-elements-in-ie6/">Hover for non-anchor elements in IE6</a></strong></p>
<p>The :hover pseudo-class adds a special style to an element when you mouse over it.</p>
<p>The &#8216;:hover&#8217; pseudo-class works fine in <abbr title="Internet Explorer 7">IE7</abbr>, <abbr title="Firefox">FF</abbr>, Safari and Opera for all the elements. But for obvious reasons <abbr title="Internet Explorer 6">IE6</abbr> fails to recognize the &#8216;:hover&#8217; pseudo-class for all elements other than the anchor(&lt;a&gt;&lt;/a&gt;).</p>
<p>The &#8216;:hover&#8217; pseudo-class can be made to work in IE6 with the help of  the jQuery method &#8216;hover()&#8217;.</p>
<p>Lets see how it is done.</p>
<p><span id="more-14"></span></p>
<p>For each element that you want the &#8216;hover&#8217; to be enabled add a class &#8220;hoverable&#8221; to it.</p>
<pre class='brush:html'>
<div id="theBox" class="hoverable">
<h2>Hover Over Me!</h2>
</div>
</pre>
<p>In the CSS file define the style for the hovered state with a class &#8220;.hovered&#8221;.</p>
<pre class='brush:css'>   #theBox {
       width:200px;
       height:200px;
       background:#F1E592;
       margin:50px auto;
       border:5px solid #540505;
    }
   #theBox.hovered, #theBox:hover {
       width:200px;
       height:200px;
       background:#540505;
       border:margin:50px auto;
       border:5px solid #F1E592;
    }</pre>
<p>Now the jQuery part,  download the latest release of jQuery.js file from <a href="http://docs.jquery.com/Downloading_jQuery">http://docs.jquery.com/Downloading_jQuery</a> and include it in the head of the page as shown below,</p>
<pre  class='brush:html'>&lt;script src="jquery.js" type="text/javascript"&gt;&lt;/script&gt;</pre>
<p>Use the following code in between the &#8216;&lt;head&gt;&lt;/head&gt;&#8217; tags in your page to get the hover function in IE6.</p>
<pre class='brush:javascript'> &lt;script type="text/javascript"&gt;
$(document).ready(function() {
       $('.hoverable').hover(
          function() {
             $(this).addClass('hovered');     /* On hover add the class 'hovered' and apply the hovered styles */
          }, function() {
             $(this).removeClass('hovered');  /* On mouseout remove the class 'hovered' and reset the styles   */
          }
       );
    });
&lt;/script&gt;</pre>
<p>This will work in all browsers. I&#8217;ve also added the &#8216;:hover&#8217; pseudo-class to the CSS style so that the modern browsers can display the hover style even when JavaScript is disabled.</p>
<p>View the code in action at <a href="http://blog.delivi.com/examples/ie6-hover/index.html">http://blog.delivi.com/examples/ie6-hover/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.delivi.com/javascript/hover-for-non-anchor-elements-in-ie6/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>safeMail : Anti-Spam Email with Unobtrusive Javascript</title>
		<link>http://blog.delivi.com/javascript/safemail</link>
		<comments>http://blog.delivi.com/javascript/safemail#comments</comments>
		<pubDate>Sun, 02 Dec 2007 10:47:01 +0000</pubDate>
		<dc:creator>livingston</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Unobtrusive Javascript]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.delivi.info/javascript/safemail/</guid>
		<description><![CDATA[Title : safeMail Version : 1.0 Language : Javascript Author : Livingston Samuel License : Download : safeMail.js If you&#8217;ve included your email address in your site then you&#8217;d definitely get junk mail that clogs your inbox. The Spam Bots &#8230; <a href="http://blog.delivi.com/javascript/safemail">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="infobox">
<ul>
<li><em>Title : </em>safeMail</li>
<li><em>Version : </em>1.0</li>
<li><em>Language : </em>Javascript</li>
<li><em>Author : </em><a href="http://delivi.com/">Livingston Samuel</a></li>
<li><em>License : </em><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/in/"><br />
<img class="no" style="width: 80px;" src="http://i.creativecommons.org/l/by-sa/2.5/in/80x15.png" alt="Creative Commons License" /><br />
</a></li>
<li><em>Download : </em><a href="http://blog.delivi.com/get/safeMail">safeMail.js</a></li>
</ul>
</div>
<p>If you&#8217;ve included your email address in your site then you&#8217;d definitely get junk mail that clogs your inbox. The Spam Bots and Spam Crawlers crawl through the web pages constantly and add all the email address they encounter to their lists.</p>
<p>I wanted a perfect solution to keep the Spam Bots away from my email address. I came across several solutions based on Javascript. But none of them was generalized, almost all of them I encountered used Javascript to insert the email address and each address needed to be coded individually. You can find a similar solution from <a href="http://www.joemaller.com/js-mailer.shtml">Joe Maller</a><br />
<span id="more-13"></span><br />
I wanted a solution that can generate the email address from an obscure form into a valid one on the fly, and thus resulted in <strong>safeMail</strong>.</p>
<p>The <strong>safeMail</strong> script uses <acronym title="Document Object Model">DOM</acronym> to scan the page and convert all the matching email entries into valid email links.</p>
<p>All you&#8217;ve to do is to download the &#8216;<a href="http://blog.delivi.com/get/safeMail"><strong>safeMail.js</strong></a>&#8216; file and include it in the header of the page where you&#8217;ve got one or more email address. The format you need to define the email address is,</p>
<pre class='brush:html'><span class="safeMail">
	 yourname [at] gmail [dot] com
</span></pre>
<p>The script will replace this as ,</p>
<pre class='brush:html'><span class="safeMail">
	 <a href="mailto:yourname@gmail.com">yourname@gmail.com</a>
</span></pre>
<p>View the <a href="http://blog.delivi.com/examples/safeMail/">safeMail in action</a></p>
<p>If the browser does not support Javascript or if the user has disabled Javascript the email address will be in accessible format.</p>
<p>You are free to modify this code and please link back to this page. If you&#8217;ve any suggestions or found any errors or facing any problem in implementing the safeMail, post it in the comments and I&#8217;ll be very glad to help you. If you find a better solution please share it with me <img src='http://blog.delivi.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.delivi.com/javascript/safemail/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
